Constructor Destructor – C++ Programming Interview Questions

(Last Updated On: February 25, 2019)

C++ tricky and conceptual programming interview questions  and answers on constructor and destructor with explanation asked in technical interviews.

Topic – Constructor and Destructor


Q-In below class, write a constructor to initialize const data member.

Answer: To initialize a const data member we need to use initializer list in the class constructor.

We can not initialize const data member in C++ using assignment operator in constructor e.g.

Example: correct way to initialize const data