If I have two objects like the dog and cat below and I wanted a instance of Cat to find out the age of an instance of Dog, how would I do that?
A function like int AskDogAge(&Dog theDog); // How would this work?
This is probably easy but I am very slow. Please help.
class Cat {
public: Cat(){}
~Cat(){}
int GetAge() {return itsAge;}
void SetAge(int age) {itsAge = age;}
private:
int itsAge;
}
class Dog {
public: Dog(){}
~Dog(){}
int GetAge() {return itsAge;}
void SetAge(int age) {itsAge = age;}
private:
int itsAge;
}



LinkBack URL
About LinkBacks


