⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 complex.h.svn-base

📁 QT方面的开发
💻 SVN-BASE
字号:
#include <iostream>using namespace std;/** A pair of double, <re, im>     where re is the "real" coordinate    and im is the "imaginary" coordinate.    Mathematically, we think of this pair as     representing the expression  re + im*sqrt(-1) */class Complex {    // binary non-member friend function declarations    friend ostream& operator<<(ostream& out, const Complex& c);    friend Complex operator-(const Complex& c1, const Complex & c2);    friend Complex operator*(const Complex& c1, const Complex & c2);    friend Complex operator/(const Complex& c1, const Complex & c2);        public:    Complex(double re = 0.0, double im = 0.0);        // binary member function operators    Complex& operator+= (const Complex& c);    Complex& operator-= (const Complex& c);        Complex operator+(const Complex & c2); /* This hould be a         non-member friend like the other non-mutating        operators. */    private:    double m_Re, m_Im;};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -