Okay let's put my short-term memory to test and try and get this figured out according to what you said you want done:
Alright, you have Cat access Dog's age:
Code:
int Cat::GetDogAge(Dog &mutt)
{
return mutt.GetAge();
}
Now, you want Dog to make sure that Cat is old enough. So modify the function to this:
Code:
int Cat::GetDogAge(Dog &mutt)
{
if (mutt.GetCatAge(this) < 3)
{
// GetCatAge() takes a pointer to a Cat and returns it's age
// If its age is less than 3, it's not old enough
cout << "Cat isn't old enough!\n";
return -1;
}
else
return mutt.GetAge();
}
Hope that helps a little.
Brendan