C++ Programming - Constructors and Destructors - Discussion

Discussion Forum : Constructors and Destructors - General Questions (Q.No. 1)
1.
A constructor that accepts __________ parameters is called the default constructor.
one
two
no
three
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
23 comments Page 2 of 3.

Alok raj said:   1 decade ago
Default constructor uses default values if it is required. The sense of "if it is required" is in this sense guys if less argument is given then required then only it is used.

So if no argument is given that it will use default values. Thus default constructor.

Priyanka said:   1 decade ago
Constructor does not contain any argument called default constructor.

Premchandar777 said:   1 decade ago
The term default in the sense, it takes common value (default) when its not assigned.

Sabyasachi lenka said:   1 decade ago
If there is any argument type constructor is present, then,

We have to declare constructor function for each and every class type objects passing argument.

In other case if object doesn't pass any value then compiler itself automatically construct a no argument type default constructor.

That's all.

Rohan said:   1 decade ago
It does not take any arguments or parameters.

#include<iostream.h>
#include<conio.h>
class integer
{
private: //optional
int m,n;
public:
integer() //default consturctor
{
m=0;
n=0;
}
};
void mian()
{
integer i1; //object created
getch();
}

Goral patel said:   1 decade ago
Default constructor we simply means that it has no argument. In this way we pass some argument then it is not default. But when this arguments with default values is called default cons.

Yog patil said:   1 decade ago
Default constructor does not take any argument. its syntax is given as:

sample( )
{
x=0;
y=0;
}

Vijayakumar said:   1 decade ago
If it takes parameter it is not default constructor.

Animesh said:   1 decade ago
If you supply a constructor with parameters then a default will not be created.

Sathish said:   1 decade ago
Why does not using of parameters ?


Post your comments here:

Your comments will be displayed after verification.