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 type of question are asked in GE code writing test based on c++ data structures and pointers?
What is #include iostream?
What do you mean by function pointer?
What is virtual function? Explain with an example
What is general format for a prototype?
What is oops in c++?
What is a stack? How it can be implemented?
Explain the benefits of proper inheritance.
Why do we learn c++?
What is difference between class and function?
What is the disadvantage of using a macro?
What is setfill c++?
Why is c++ not purely object oriented?
Is c++ an integer?
What are shallow and deep copy?