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
How can you quickly find the number of elements stored in a dynamic array?
Explain the static member function.
How do you declare A pointer to a function which receives nothing and returns nothing
Is it possible for a member function to delete the pointer, named this?
What is the type of 'this' pointer? When does it get created?
How do we balance an AVL Tree in C++?
What is the best way to declare and define global variables?
What is linked list in c++?
What is a multimap c++?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
By using c++ with an example describe linked list?
How does atoi function work?
What is a friend function in c++?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
Can a program run without main function?