Hi guys, I know what is meant by vector <string> myvector as it will just take every inputs as string when we are trying to store the inputs in myvector.
e.g. myvector.push_back(nick)
but what about if we declare the type of vector become like vector <FLATMATE> myvector?
Why it won't take any inputs and give some error?
e.g.
class FLATMATE
{
string name;
public:
FLATMATE() { name = "";}
FLATMATE(string n){name = n;}
string getName(){return name;}
void setResident(string n){name = n;}
};
vector <FLATMATE> myvector
what is the valid input for myvector to store something? Just need to get this stuff around my head..