I have this function
# include "Rectangle.hh"
# include "Circle.hh"
void inst_obj (int symbols) {
for (int i=0; i<symbols ; i++) {
if (i<10) {
Rectangle symb(1,2,3);
//Store symb in an array, like symb_array[i] = symb;
}
else {
Circle symb(1,2,3,4);
//Store symb in an array, like symb_array[i] = symb;
}
}// inst_obj
Then i have another function:
void check_symbols(symbols) {
for (int i=0; i<symbols; i++) {
// Check symbol objects, like symb_array[i].return_something
}
} // check_symbols
How can you store the pointers to the different objects in an easy way? (and how do you then access them)?