class creature()
public:
void greet(){
cout<<"Hello"<<endl;
}
};
class human : public creature{
public:
void greet(){
cout<<"Hello, i am a human"<<endl;
}
}
vector<creature> creatures;
human human1;
creatures.push_back(human1);
creatures[0].greet();
The output is then:
Hello
It should be: Hello, i am a human
What is the solution?
Greetzzz
Hyperion
This post has been edited by manhaeve5: 05 May 2007 - 05:51 AM

New Topic/Question
Reply




MultiQuote





|