For a struct Complex that represents a complex number:
struct Complex {
int real;
int imaginary;
};
the non-member subtraction operator (-) is implemented as:
const Complex operator - (const Complex& c1, const Complex& c2) {
Complex result = {
c1.real - c2.real,
c1.imaginary - c2.imaginary
};
return result;
}
Given 3 instances of Complex:
Complex c1 = { 10, 23 };
Complex c2 = { 7, 25 };
Complex c3 = { 15, 30 };
Which one of followings usage of subtraction operator ('-') is not valid (will not compile):