Basically I'm having difficulty figuring out what to return to a function. Here is my problem:
I have a class called Zoo that contains Animal objects in an array of pointers called cages e.g..
class Animal{
double weight;
double height;
double speed;
double power;
Animal(){}
};
class Zoo{
Animal ** cages;
Zoo(){
cages = new Animal*[10];
}
};
Each animal object has some properties like height,weight,power,speed, etc..
The problem is: What is the best way to return the data contained by cages to a function that needs to NOT know about the zoo class. So, I cannot simply return a pointer to the zoo class, or an object of the zoo class, or an object of the animal class. So what in the world can I return? My initial thought it to make an array of strings such that each element contains the data from a cage seperated by commas or something, but I HATE parsing strings. Is there perhaps a better way????