Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
88 / 187
Distinguish between default constructor and default argument constructor?
Answer:
Default constructor:
1. The constructor that accepts no parameter is called is a default constructor.
2.it is used in class by
A :: A( )
Default argument constructor:
1. The default argument constructor can be called with either one argument or no arguments.
2. It is used in class by
A:: A(int =0)
Asked In ::
Ranjana
23 Feb, 2019 5:07 AM
Default constructor:
1. The constructor that accepts no parameter is called is a default constructor.
2.it is used in class by
A :: A( )
Default argument constructor:
1. The default argument constructor can be called with either one argument or no arguments.
2. It is used in class by
A:: A(int =0)
1. The constructor that accepts no parameter is called is a default constructor.
2.it is used in class by
A :: A( )
Default argument constructor:
1. The default argument constructor can be called with either one argument or no arguments.
2. It is used in class by
A:: A(int =0)