1.

What Is Conversion Constructor?

Answer»

A conversion constructor is a single-parameter constructor that is declared without the function specifier 'explicit'. The COMPILER uses conversion constructors to CONVERT objects from the type of the first parameter to the type of the conversion constructor's class.To define implicit CONVERSIONS, C++ uses conversion constructors, constructors that ACCEPT a single parameter and initialize an object to be a copy of that parameter.

A conversion constructor is a single-parameter constructor that is declared without the function specifier 'explicit'. The compiler uses conversion constructors to convert objects from the type of the first parameter to the type of the conversion constructor's class.To define implicit conversions, C++ uses conversion constructors, constructors that accept a single parameter and initialize an object to be a copy of that parameter.



Discussion

No Comment Found