If a class has only one constructor with one parameter, how to declare an array? I know that vector is recommended in this case. For example, if I have a class
You'd need to do an array of pointers to Foo.
Foo* myArray[10000]; for (int i = 0; i < 10000; ++i) myArray[i] = new Foo(i);