Home » C++ Programming » Templates » Question
  1. Which is called on allocating the memory for the array of objects?
    1. method
    2. destructor
    3. constructor
    4. All of above
    5. None of these
Correct Option: C

When you allocate memory for an array of objects, the default constructor must be called to construct each object. If no default constructor exists, you’re stuck needing a list of pointers to objects.



Your comments will be displayed only after manual approval.