Vidyalelo
C++ Programming · Q60

Constructors and Destructors in C++

Programming · C++ Programming · question 60

Q60

Why constructors are efficient instead of a function init() defined by the user to initialize the data members of an object?

A.
Because user may forget to call init() using that object leading segmentation fault
B.
Because user may call init() more than once which leads to overwriting values
C.
Because user may forget to define init() function
D.
All of the mentioned
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board