#include <iostream>
#include <string>
using namespace std;
/**
* 定义类:Student
* 数据成员:m_strName
* 无参构造函数:Student()
* 有参构造函数:Student(string _name)
* 拷贝构造函数:Student(const Student& stu)
* 析构函数:~Student()
* 数据成员函数:setName(string _name)、getName()
*/
class Student
{
public:
Student()
{
m_strName="";
}
Student(string _name)
{
m_strName=_name;
}
Student(const Student& stu){};
//~Student();
void setName(string);
string getName();
private:
string m_strName;
};void Student::setName(string _name){ m_strName=_name;}string Student::getName(){ return m_strName;}int main(void){ Student stu("慕课网"); cout<<stu.getName()<<endl; return 0;}