1 Star 0 Fork 0

CoderQi/cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
加号运算符重载.cpp 724 Bytes
一键复制 编辑 原始数据 按行查看 历史
CoderQi 提交于 2023-04-08 20:07 +08:00 . 运算符重载
//#include<iostream>
//using namespace std;
//class Person
//{
//public:
// int m_A;
// int m_B;
//
// //Person operator+ (Person& p)//Ա
// //{
// // Person temp;
// // temp.m_A = this->m_A + p.m_A;
// // temp.m_B = this->m_B + p.m_B;
// // return temp;
// //}
//};
//Person operator+(Person&p1,Person&p2)
//{
// Person temp;
// temp.m_A = p1.m_A + p2.m_A;
// temp.m_B = p1.m_B + p2.m_B;
// return temp;
//}
//void test01()
//{
// Person p1;
// p1.m_A = 10;
// p1.m_B = 20;
// Person p2;
// p2.m_A = 10;
// p2.m_B = 20;
// Person p3 = p1 + p2;
// cout << p3.m_A << endl;
// cout << p3.m_B << endl;
//
//}
//
//
//int main()
//{
// test01();
//
//
// return 0;
//}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/programmercg/cpp.git
git@gitee.com:programmercg/cpp.git
programmercg
cpp
cpp
master

搜索帮助