Consider the following code:
class myarray { int i; public: myarray(int a) : i(a){ } }
How can you create an array of
If you create an array of objects of class myarray ( either on stack or on heap) you would have to define a default constructor.
There is no way to pass arguments to the constructor when creating an array of objects.