why all c++ program must have default constructor?
Answer Posted / sourisengupta
When you create a Object with no arguments, the compiler automatically creates a default constructor internally. But when you use parameterized constructor in your code then you need to provide the default constructor in your code so that the compiler does not throw any errors at compile time.
It also depends on compiler. some compiler also supports this feature. then you do not need to write default constructor in the code.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What are the comments in c++?
What is the difference between global variables and local variable
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
What is c++ manipulator?
What is a c++ vector?
How long will it take to learn programming?
Why should you learn c++?
Explain binary search.
How would you obtain segment and offset addresses from a far address of a memory location?
What is capacity in vector in c++?
What does it mean to declare a member function as static?
What is microsoft c++ redistributable 2013?
What is the basic of c++?
What are 2 ways of exporting a function from a dll?
What do you mean by inheritance in c++? Explain its types.