asked 233k views
5 votes
When a dynamic array with a class for a base type is declared, which constructor is called?

1 Answer

3 votes
The default constructor is called for each element of the array. So if you declare an array with 100 elements (object instantiations), the constructor is executed 100 times!