#include <iostream>using namespace std;class CPerson{public: void Print(); CPerson();private: int age; char *name;};CPerson::CPerson(){ }void CPerson::Print(){ cout<<"name="<<name<<",age="<<age<<endl;}int main(){ CPerson ps(23,"张三"); ps.Print(); return 0; }
1 回答
- 1 回答
- 0 关注
- 1399 浏览
添加回答
举报
0/150
提交
取消