摘要: 1、"+"运算符重载: 1 #include<iostream> 2 using namespace std; 3 class Person 4 { 5 public: 6 int m_A; 7 int m_B; 8 //成员函数运算符重载 9 Person operator+(Person& p) 阅读全文
posted @ 2021-07-22 17:26 卿源 阅读(94) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 using namespace std; 3 //创建一个Person类 4 class Person 5 { 6 public: 7 Person(int age1, string name1) 8 { 9 this->age = age1; 10 t 阅读全文
posted @ 2021-07-22 16:56 卿源 阅读(105) 评论(0) 推荐(0)