What is a conversion constructor?
- Conversion constructors are used for type conversion wherein the type of argument passed is converted to the class type.
-
Example : Conversion from type int to Point.
class Point
{
public:
Point();
Point( int );
//...
};
What is a conversion constructor?
It is a constructor that accepts one argument of a different type.