Examveda

What is the difference between a constructor and a normal member function in C++?

A. Constructor can be overloaded, while a member function cannot

B. Constructor has a return type, while a member function does not

C. Constructor is called explicitly when an object is created, while a member function is called automatically

D. Constructor is called automatically when an object is created, while a member function needs to be called explicitly

Answer: Option D


Join The Discussion

Related Questions on Constructors and Destructors in C plus plus