📄
字号:
#include <iostream>
using namespace std;
class Student
{
public:
Student();
Student(char *pName);
Student(const Student& stu);
~Student();
protected:
private:
char m_cName[40];
};
Student::Student()
{
cout << "construct NULL student" <<endl;
}
Student::Student(char *pcName)
{
strcpy(m_cName, pcName);
cout << "construct new student" <<endl;
}
Student::Student(const Student& stu)
{
strcpy(m_cName, stu.m_cName);
cout << "construct copy of" << stu.m_cName <<endl;
}
Student::~Student()
{
cout << "destructing " << m_cName << endl;
}
Student Fun()
{
cout << "IN Fun()" << endl;
Student ms("zhang3");
return ms;
}
void main()
{
Student Stu;
Stu = Fun();
cout << "returned from fun()" << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -