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:D
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