杭州电子科技大学吧 关注:235,359贴子:4,360,466
  • 6回复贴,共1

有没有人看看我这程序哪错了啊

只看楼主收藏回复

#include"stdafx.h"
#include <iostream>
using namespace std;
class Student
{
public:
student(int n,,string nam,int a);
{num=n;
name=nam;
age=a;
cout<<"Constructor call."<<endl;
}
~Student()
void display()
{ cout<<"num:"<<num<<endl;
cout<<"name:"<<name<<endl;
cout<<"age:"<<age<<endl;
}
private:
int num;
string name;
int age;
};
int main()
{ Student::stud1(29,"杨佳兴",19);
stud1.display();
return 0;
}


IP属地:浙江1楼2014-04-06 21:27回复
    private 是什么


    IP属地:浙江来自Android客户端2楼2014-04-06 21:49
    回复
      2026-01-17 03:13:10
      广告
      不感兴趣
      开通SVIP免广告
      你是杨家兴?


      来自Android客户端3楼2014-04-06 22:05
      收起回复