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 many types of scopes are there in c++?
What is the difference between reference and pointer?
what are the iterator and generic algorithms.
What is c++ hiding?
Explain the static member function.
In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....
Why #include is used?
How is new() different from malloc()?
What is c++ good for?
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
Can we change the basic meaning of an operator in c++?
Why do we use double in c++?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
Define copy constructor.
why is iostream::eof inside a loop condition considered wrong?