Let's assume I have a class Object with one method which simply reports the ID number of the instance. Normally, I would hardcode the instantiation of the Object class like "Object obj_1" and the calling of the method like "obj_1.report"
My question is how do I instantiate objects procedurally, for example I want to create n number of Objects, going obj_1, obj_2 and so on till obj_n. Natural I am not asking about the actual loop but about how to instantiate the class using a variable, but taking the value of the variable instead of its name and adding it to the obj_ prefix. Perhaps with casting? Also how do I procedurally call the methods of specific instances by specifying only the ID. I think both the instantiation and the method calling will work in the same way, however as a newbie I have a hard time figuring how exactly to do it on the go instead of being hardcoded.
Thanks in advance!
EDIT: I am interested in c++ syntax