Printable View
In that way? Yes. The [4] isn't strictly necessary... You can write objects[] too, but you can't omit it.
Quote: Originally Posted by jw232 Code: ExampleClass objects[4] = {1,2,3,4}; Is initializing objects in that array only possible because the constructor only takes one argument? Is the [4] necessary? That and the constructor that takes one argument isn't labelled explicit. In such a case, initializing an array of objects won't compile.
ExampleClass objects[4] = {1,2,3,4};