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 is const pointer and const reference?
Write about the scope resolution operator?
How much do coding jobs pay?
How many standards of c++ are there?
What will the line of code below print out and why?
Define a nested class.
Write is a binary search tree? Write an algo and tell complexity?
How do you define/declare constants in c++?
Why cout is used in c++?
What are advantages of using friend classes?
How compile and run c++ program in turbo c++?
What are static type checking?
Is it possible for the objects to read and write themselves?
What do you mean by ‘void’ return type?
Is c++ a difficult language?