Home / CSE MCQs / C++ - MCQs :: Discussion

Discussion :: C++ - MCQs

  1. Which is called on allocating the memory for array of objects?
  2. A.
    destructor
    B.
    constructor
    C.
    method
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    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.


Be The First To Comment