//运算重载左移函数

//运算重载左移函数
#include
using namespace std;

class p
{
public:
string mingzi;
string dengji;
};

ostream & operator<<(ostream& cout, p& p1)
{
cout << p1.mingzi << endl;
cout << p1.dengji << endl;
return cout;
}

void z()
{
p p1;
p1.mingzi = “宇智波杀死给”;
p1.dengji = “SSS+忍”;
p p2;
p2.mingzi = “漩涡那日托”;
p2.dengji = “SSS+忍”;
cout << p1 << endl;
cout << p2 << endl;
}
int main()
{
z();
system(“pause”);
return 0;
}

猜你喜欢

转载自blog.csdn.net/ADADQDQQ/article/details/108279027