why all c++ program must have default constructor?
Answer Posted / rahin99435
The purpose of constructor is to initialize the class members and allocate necessary resources for them; at runtime.So by default C++ compiler is provided with a default constructor which performs the same job at runtime while the object is created.
There is provision of defining more than one constructor by changing the signatures to get objects of different kind.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the full form of stl in c++?
When should we use multiple inheritance?
What will happen if a pointer is deleted twice?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Do we have to use initialization list in spite of the assignment in constructors?
What is c++ manipulator?
If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?
Explain how we implement exception handling in c++?
What does scope resolution operator do?
What you know about structures in C++?
What is a null object in c++?
What is the best way to take screenshots of a window with c++ in windows?
What are c++ tokens?
What do you mean by public protected and private in c++?
Should I learn c++ c?