What is the role of a constructor in classes?
A. To modify the data whenever required
B. To destroy an object
C. To initialize the data members of an object when it is created
D. To call private functions from the outer world
Answer:C
What is the role of a constructor in classes?
A. To modify the data whenever required B. To destroy an object C. To initialize the data members of an object when it is created D. To call private functions from the outer world