#include<iostream>
#include<string>
using std::string;
using std::cout;
using std::endl;
class Student
{
private:
int m_num;
string m_name;
char m_sex;
public:
Student(int num,string name,char sex):m_num(num),m_name(name),m_sex(sex)
{
cout << "Constructor called." << endl;
}
~student()
{
cout << "Destructor called." << endl;
}
void display ()
{
cout << "num:" << num << endl;
cout << "name:" << name << endl;
cout << "sex:" << sex << endl << endl;
}
};
int main()
{
Student stud1 (101, "Wangli", 'f');
stud1.display ();
Student stud2 (102, "Limin", 'm');
stud2.display ();
return 0;
}