正在加载图片...
第8章多态性 例8.2复数乘法运算源程序 #include iostream h class CComplex private double real double imag; public CComplex(double r=0, double i =O) void Printo CComplex operator +(CComplex c) CComplex operator-(CComplex c) CComplex operator *(CComplex c) CComplex C Complex(double r, double i real =r Imag例8.2 复数乘法运算源程序 #include "iostream.h" class CComplex { private: double real; double imag; public: CComplex(double r=0, double i=0); void Print(); CComplex operator +(CComplex c); CComplex operator -(CComplex c); CComplex operator *(CComplex c); }; CComplex::CComplex (double r, double i) { real = r; imag = i; } 第8章 多态性
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有