📄 student.cpp
字号:
//student.cpp
#include<iostream.h>
#include<string.h>
#include"student.h"
student::student(char *s,int t)
{
name=new char[strlen(s)+1];
strcpy(name,s);
score=t;
}
student::student(student &p)
{
name=new char[strlen(p.name)+1];
score=p.score;
}
student::~student()
{
delete[]name;
}
void student::display(void)
{
cout<<"姓名:"<<name<<" 成绩:"<<score<<endl;
}
int student::get_s(void)
{
return(score);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -