正在加载图片...
第二节运算符重载(教材P253-285) complex complex: operator+( complex c)/重载"“+” &complex temp temp. real-real+C real temp. imag=imag+cimag return temp; complex complex: operator-( complex c)/重载“” f complex temp temp. real-real-c real; temp.imag-imag-cimag return temp第二节 运算符重载(教材①P253-285) complex complex ::operator+(complex c)//重载“+” {complex temp; temp.real=real+c.real; temp.imag=imag+c.imag; return temp; } complex complex ::operator-(complex c)//重载“-” { complex temp; temp.real=real-c.real; temp.imag=imag-c.imag; return temp; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有