C++ Constructors Question:
Download Questions PDF

Which of the following gets called when an object is being created?

A. constructor
B. virtual function
C. destructor
D. main

Answer:

Option A
constructor

Download C++ Constructors Interview Questions And Answers PDF

Previous QuestionNext Question
Can you please explain the order in which constructors are called when an object of a derived class is created?To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .

A. destructor
B. delete
C. delete[]
D. kill[]
E. free[]