79
};
inline complex operator+(complex a, complex b) // complex+complex
{ complex c; c.re=a.re+b.re; c.im=a.im+b.im; return c;}
inline complex operator+(complex a, double x) //complex+double
{ complex c; c.re=a.re+x; c.im=im; return c;}
inline complex operator+(double x, complex a) // double + complex
{ complex c; c.re=a.re+x; c.im=im; return c;}
Funksiya – amalni chaqirish:
complex c = a + b; // qisqa yozuv
complex d = operator+(a,b); // oshkora chaqirish
Dostları ilə paylaş: