Example Program: Part 4
complex complex::operator+(complex b)
real = p_real + b.p_real;
imaginary = p_imaginary + b.p_imaginary;
return complex(real, imaginary);
complex complex::operator-(complex b)
return complex(p_real - b.p_real, p_imaginary - b.p_imaginary);
int complex::operator==(complex b)
// if any of the members don't match, return 0
if (p_imaginary != b.p_imaginary)
// everything ok: return 1