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
Differentiate between a constructor and a method in C++.
What is a block in c++?
When to use “const” reference arguments in a function?
What is the return value of the insertion operator?
What are files in c++?
Explain the difference between overloading and overriding?
Which is most difficult programming language?
Is c++ slower than c?
What are literals in C++?
What is the first name of c++?
What are smart pointers?
What is setiosflags c++?
What is endl?
Is c++ still in demand?
How a new element can be added or pushed in a stack?