#include <iostream>
using namespace std;
class Person
{
public:
Person person(int age)
{
m_age=age;
}
Person & PersonAdd(Person &p)
{
this->m_age+=p.m_age;
return *this;
}
int m_age;
};
void test01()
{
Person p1,p2;
p1.person(10) ;
p2. PersonAdd(p1). PersonAdd(p1);
cout<<p1.m_age<<" "<<p2.m_age<<endl;
}
int main()
{
test01();
return 0;
}
链式编程思想
最新推荐文章于 2024-05-21 10:33:53 发布