#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;
}
#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;
}










