Hi guys, I just started to learn class in C++ and get confused by some of the codes
class FLATMATE
{
string name;
public:
FLATMATE() { name = "";}
FLATMATE(string n){name = n;}
string getName(){return name;}
void setResident(string n){name = n;}
};
//Below are the base class for different duty types
class DUTY
{
FLATMATE resident; <<<<<<<<<<What do we call this one? object or constructor or something else?
}
any idea what is the name for the "FLATMATE resident "in the class Duty? is it an object?
And what will happen to the resident in class Duty? Get initialized?