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
Define upcasting.
What is a container class? What are the types of container classes in c++?
What does new return if there is insufficient memory to make your new object?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
Will the following program execute?
Give 10 points of differences between C & C++.
Describe new operator?
Can we use struct in c++?
Does c++ have foreach?
What is a hash function c++?
What is the real purpose of class – to export data?
Can I uninstall microsoft c++ redistributable?
what is pre-processor in C++?
Describe linkages and types of linkages?
Write syntax to define friend functions in C++.