#include
using namespace std;
The class Complex
{
Public:
Complex (double r, double I) : real (r), imag (I) {}
Operator double ()
{
cout <"Type conversion function called" & lt;
Return real;
}
Private:
Double real;
Double imag;
};
Int main ()
{
Complex C (1, 2);
Double a=3.3;
cout
return 0;
}
CodePudding user response:
Because he can automatically converted to double