i have a class
class Example{
private:
int number;
char grade;
char name[50];
public:
int getNumber();
.
.
.
};
i have a method that returns a pointer to objects of this type.
E.g.
Example* returnObject();
i want to add this into an array:
Example* myArray=new Example[size];
for(int i=0 ; i < 0 ; i++)
newExample[i]=returnObject();
//this doesn't work!
can anyone please explain to me "how to add objects to a dynamic array, based on a function that returns a pointer to the object in question?
cheers,
Simon.