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
Can a class be static in c++?
What is expression parser in c++
What is the difference between global int and static int declaration?
What does catch(…) mean?
Can a new be used in place of old mallocq? If yes, why?
How are virtual functions implemented in c++?
Is rust better than c++?
What is the difference between a pointer and a link in c ++?
What are guid? Why does com need guids?
What is copy constructor? Can we make copy constructor private in c++?
Which is best c++ or java?
Write about the various sections of the executable image?
What is runtime polymorphism in c++?
What are the manipulators in c++?
Can we specify variable field width in a scanf() format string? If possible how?