462 Topics
| |
a C++ newbie here.. I am doing the question at the end of Ch3 which is about classes, objects, and constructors. I'm stuck on a few that asks you to write a C++ statement for each: (On 5, I wasn't sure how to give a value in the same statement.. … | |
[B]This has been solved! Look at the end of this post.[/B] Hello! I'm having some trouble here with polymorphism, as I need to access methods in a subclass from an array of superclass objects. This method is called parseCommand(Command c); The method exists in the superclass and is overridden in … | |
I just started an advanced C++ course and my instructor sent around a file with this piece of code: [code]class smallobj // specify a class { public: smallobj() : iData(0){} // Constructor smallobj(int iInValue) : iData(iInValue) {} // Overloaded Constructor ~smallobj() {} // Destructor void setdata(int d) // member function … | |
How many constructor (including copy constructor) and destructors will be called for test1 and test2? [CODE]#include <iostream> using namespace std; class Base{ public: Base(){cout << "Base()" << endl;} Base(const Base&){cout << "Base(const Base&)" << endl;} ~Base(){cout << "~Base()" << endl;} }; Base func(Base b){return b;} void test(){ Base a; func(a); … | |
Hi everyone. I'm currently working on a project with c#, and had some questions about classes. I'm a python programmer, so bear with me ;) How would I make a class that has pre defined arguments? I.e. even if the user doesn't pass that arguement, the default value of it … | |
| Hello, I am using Blue J, I have 3 classes, time, date and patient. When I run the patient class, I can put patient details like name, address, DoB, time. The time and date classes are separate classes, how can I store the date (int) and time which I enter … |
Hey all - yes, this is another thread asking for some homework help, but I've got a solid start, just looking for some fresh ideas. Anyways, the task is to create a java clock class and access/use it from a driver. I saw something similar on here, but not quite … | |
I've worked with making classes, but I've never had to use a class in code that I write, so I'm having a hard time. [CODE]#include <iostream> #include <string.h> #include <iomanip> #include <ctype.h> #include "String2.cpp" using namespace std; const int MAX_WORD_LENGTH = 254; // The type definition below permits much easier … | |
I am sorry to ask such a beginner question: I am just learning to use classes and objects in php and would like to know one simple thing - how to you reference one function (or should I call them methods?) from another within the class. When I specify a … | |
1. Create a class Account that has following instance variables: a. private account number (string) b. private account holder name (string) c. private balance (floating-point) d. private account opening date (string) e. profitRate (final, floating-point): 5% for all accounts Supply a default constructor, a parameterized constructor, and a clone constructor. … | |
So, hi, this is my first post here. I can't find a good source for my problem here. My problem: Creating a linked node using classes. I managed to create a list of linked nodes but the problem was that I forgot to delete the nodes I created so now … | |
Everyone is talking about how open source technology is the answer to budget cuts and belt tightening in the workplace. There's no denying its use is on the rise and, in fact, the Linux server market is predicted to extend into the tens of billions over the next few years. … |
The End.