I have a class A whose objects are created dynamically:
A *object;
object = new A;
there will be many objects of A in an execution. i have created a method in A to return the address of a particular object depending on the passed id.
A *A::get_obj(int id)
implemetation of get_obj requires itteration so i chose vectors to store the addresses of the objects.
vector<A *> myvector
i think another way to do this is by creating a file & storing the address as a text on a particular line (this will be the id). this will help me reduce memory usage as i will not create a vector then. what i dont know is that will this method consume more time than the vector method? any other option of doing the same is welcome.