I have a class and I want to create an array of objects of this class.
I have a constructor and I have no trouble initializing a single object,
but when it comes to an array the compiler starts complaining.
I don't have a book with me right now, so I got away by creating an array of pointers to the object and then initializing these pointers in a loop.
What's the right way to accomplish this task?
Thank you in advance.
I have a constructor and I have no trouble initializing a single object,
but when it comes to an array the compiler starts complaining.
I don't have a book with me right now, so I got away by creating an array of pointers to the object and then initializing these pointers in a loop.
What's the right way to accomplish this task?
Thank you in advance.