C++, array of objects without

后端 未结 9 1745
渐次进展
渐次进展 2020-12-08 07:34

I want to create in C++ an array of Objects without using STL.

How can I do this?

How could I create array of Object2, which has no argumentless constructor

9条回答
  •  悲哀的现实
    2020-12-08 08:04

    If no default constructor is available, you will need an array of pointers, and then loop over that array to initialize each of the pointers.

提交回复
热议问题