override the operator overloading in C++ ?
- by stdnoit
helo guys
i have class call Complex
I did operator overloading like such
Complex c = a + b; // where a and b are object of Complex class
which basically is operator+(Complex& that);
but I dont know how to say for example
double c = a + 10; //where a is object of Complex class but 10 is integer / double
I did define typecasting for a to be double get my IDE says that there are too many operands + and it somehow complains for not being able to "understand" the +
it has to be in this format though double c = a + 10;
thanks