#include<iostream>
using namespace std;
class Complex
{
public:
friend ostream& operator<<(ostream &out, Complex &c);
Complex(int a=0, int b=0)
{
this->a = a;
this->b = b;
}
private:
int a;
int b;
};
ostream& operator<<(ostream &out, Complex &c)
{
out << "12345 生活真是苦"<<endl;
out << c.a << "+" << c.b << "i";
return out;
}
void main()
{
Complex c1(1,1);
Complex c2(2,2);
cout << c1<<"12345 上山打老虎";
system("pause");
}
博客围绕C++重载移移运算符展开,虽未提供具体内容,但可知聚焦于C++这一编程语言中移移运算符的重载操作,属于信息技术领域的后端开发范畴。
376

被折叠的 条评论
为什么被折叠?



