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
Why constructors are efficient instead of a function init() defined by the user to initialize the data members of an obj
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Why constructors are efficient instead of a function init() defined by the user to initialize the data members of an obj
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!