#include <iostream>
using namespace::std;
class MyClass
{
public:
MyClass(int a, int b)
{
this->a = a;
this->b = b;
}
void print_Myclass()
{
cout << this->a << '+' << b << 'i' << endl;
}
friend ostream & operator<<(ostream &os,
c++ 左移右移操作符重载
最新推荐文章于 2024-07-27 11:20:35 发布
本文详细探讨了C++编程中左移<<和右移>>操作符的重载,包括它们在位运算和自定义类型中的应用,以及如何实现这些操作符的友元函数版本,帮助理解其工作原理和使用技巧。
摘要由CSDN通过智能技术生成