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

📄 complex0.h

📁 我学习C++ Primer Plus过程中写下的课后作业的编程代码
💻 H
字号:
#ifndef COMPLEX0_H_
#define COMPLEX0_H_
#include <iostream>

namespace COMPLEX
{
	class complex
	{
	private:
		double real;	//实数
		double imaginary;	//虚数
	public:
		complex();		//默认构造函数
		complex( double r, double i );
		~complex();
		complex operator + (const complex & c )const;
		complex operator - (const complex & c )const;
		complex operator * (const complex & c )const;
		complex operator * ( double	x )const;
		complex operator ~ ()const;
		//friends
		friend std::istream & operator>> ( std::istream & os, complex & c);
		friend std::ostream & operator<< ( std::ostream & os, const complex & c);
		friend complex operator * ( double x, const complex & c);
	};
}

#endif

⌨️ 快捷键说明

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