Google News
logo
CPP - Quiz(MCQ)
What happens if a user forgets to define a constructor inside a class?
A)
Error occurs
B)
Segmentation fault
C)
Compiler provides a default constructor to avoid faults/errors
D)
Objects are not created properly

Correct Answer :   Compiler provides a default constructor to avoid faults/errors


Explanation : The C++ compiler always provides a default constructor if one forgets to define a constructor inside a class.

Advertisement