为了账号安全,请及时绑定邮箱和手机立即绑定

学到C++的类和对象 一个程序把我难倒了

学到C++的类和对象 一个程序把我难倒了

C++
慕粉4444739 2016-12-07 18:32:35
#include <iostream> using namespace std; class CPerson { public:        void Print(); private:        CPerson(); private:        int age;        char *name; }; CPerson::CPerson() { } void CPerson::Print() {        cout<<"name="<<name<<",age="<<age<<endl; }   void main() {        CPerson ps(23,"张三");        ps.Print(); }说是有三大错误  但是怎么改都不行TAT  上面是给出的代码。。。
查看完整描述

1 回答

  • 1 回答
  • 1 关注
  • 1435 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号