标签:str private turn 运算 pac 类型 highlight names stream
#include <iostream> using namespace std; class Complex { private: double real,imag; public: Complex(double r=0,double i=0):real(r),imag(i){} operator double(){return real;} //返回类型为重载类型 //double n=2+c; //double n=2+c.operator double(); }
标签:str private turn 运算 pac 类型 highlight names stream
原文地址:https://www.cnblogs.com/-Asurada-/p/10731719.html