Hi Guys,
We're working with c++ to create an animal hierarchy and I'm having trouble trying to assign values and create the displaydata() function. Can anyone point me in the right direction please.
Thanks!
We're working with c++ to create an animal hierarchy and I'm having trouble trying to assign values and create the displaydata() function. Can anyone point me in the right direction please.
Thanks!
Code:
class animal {
protected:char sound[10];
int fly;
public:virtual void displaydata();
};
class cow : public animal {
private:int numberoflegs;
public : void displaydata();
};
class bird : public animal {
public:void displaydata();
};
int main (int argc, char * const argv[]) {
bird *tweet = new bird;
tweet->displaydata();
return 0;
}
Comment