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 happens when the extern "c" char func (char*,waste) executes?
What is the this pointer?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
What is a constant reference?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
Is oops and c++ same?
How do you add an element to a set in c++?
what are the iterator and generic algorithms.
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
What are the methods of exporting a function from a dll? What is the return value of the insertion operator? What are the syntactic rules to be avoid ambiguity in multiple inheritance? Write a program which is required to process the time of a
clock in hours and minutes, entered from the keyboard. With
this program, there are two requirements for any data
entered by a user:
1. The data must be of the correct type (in this case, two
ints).
2. The data must be in the correct range: this means that,
for the minutes, negative numbers and any number above 59
must be rejected; for the hours, negative numbers and any
number above 23 must be rejected.
Output error message for invalid data input.
Output the time one and a half hour after the time input.
i.e.
Hour: 22
Min: 32
One and a half hour after 22:32 is 00:02
What are the rules about using an underscore in a c++ identifier? Write an algorithm that determines whether or not an almost
complete binary tree is a heap.