There a couple of ways. One is with a pointer to a pointer to objects and use it as an array.
Example:
Code:
PersonInfo** RetrieveArrayOfObjectsViaPtrToPtr(void);
int main(int argc, char **argv)
{
PersonInfo** x = RetrieveArrayOfObjectsViaPtrToPtr();
x[0]->Draw();
x[1]->Draw();
delete x[0];
delete x[1];
return 0;
}
PersonInfo** RetrieveArrayOfObjectsViaPtrToPtr(void)
{
PersonInfo** arr = new PersonInfo*[2];
arr[0] = new PersonInfo("one");
arr[1] = new PersonInfo("two");
return arr;
}
class PersonInfo has a Draw member method.
Don't forget to delete the pointer to pointers!