#include
#include
#include
#define M 5000
using namespace std;
class student
{
public:
student(){}
student(char na[10],char se[10],int n,int b,char t[12]):num(n),ban(b)
{
strcpy(sex,se);
strcpy(name,na);
strcpy(tel,t);
}
friend istream & operator >>(istream & is,student & s)
{
is>>s.name>>s.sex>>s.num>>s.ban>>s.tel;
return is;
}
friend ostream & operator <<(ostream & os,student & s)
{
os<<s.name<<" "<<s.sex<<" "<<s.num<<" "<<s.ban<<" "<<s.tel<<endl;
return os;
}
int getnum()
{
return num;
}
int getban()
{
return ban;
}
char *getsex()
{
char *s=new char[strlen(sex)];
s=sex;
return s;
}
char *getname()
{
char *p=new char[strlen(name)];
p=name;
return p;
}
char *gettel()
{
char *t=new char[strlen(tel)];
t=tel;
return t;
}
private:
char name[10];
char sex[10];
int num,ban;
char tel[12];
};
麻烦注释一下代码,搞不懂啥意思 ?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
悬赏问题
- ¥20 腾讯企业邮箱邮件可以恢复么
- ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
- ¥15 错误 LNK2001 无法解析的外部符号
- ¥50 安装pyaudiokits失败
- ¥15 计组这些题应该咋做呀
- ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
- ¥15 让node服务器有自动加载文件的功能
- ¥15 jmeter脚本回放有的是对的有的是错的
- ¥15 r语言蛋白组学相关问题
- ¥15 Python时间序列如何拟合疏系数模型