- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
学生管理系统(Student management system)
学生管理系统(Student management system)
# stdio.h in
# stdlib.h in
# string.h in
/ * 自定义学生信息结构为student * /
typedef struct stu
{
char id [10]; / * 学号 * /
char name [10]; / * 姓名 * /
char class [10]; / * 班级 * /
} the student;
/ * 自定义房间结构体为room * /
typedef struct r
{
int roomnum 房间号; / * * /
student * stu [4]; / * 定义结构体指针数组 * /
} room;
int n = 0; / * 定义全局变量 * /
student * cln [16]; / * 定义结构体指针数组, 每个床的信息 * /
room studentroom [4]; / * 结构数组 * /
file * fp 定义文件指针; / * * /
/ * 输入学生信息 * /
void get (student * p)
{
fflush (stdin); / * 用scanf () 在键盘上接受字符型数据是, 必须用fflush (stdin)
这个函数来清楚上一次存储的数据, 不然字符型数据不会正确的存储 * /
printf (输入学生学号:);
gets (p - id);
printf (输入学生姓名:);
gets (p - name);
printf (输入学生班级:);
gets (p - class);
}
/ * 输出学生信息 * /
void put (student * p)
{
if (p)
printf (学号:% s, p - id);
printf (名字:% s, p - name);
printf (班级:% s, p - class);
}
/ * 初始化 (柳维奎) * /
int role (void)
{
int i, j;
if ((fp = fopen (\ \ client.dat, wb +)) = = null) 以写的形式打开文件 / * * /
{
printf (cannot open file client.dat! );
return 0;
}
/ * 定义房间号 * /
studentroom [0].roomnum = 101;
studentroom [1].roomnum = 102;
studentroom [2].roomnum = 201;
studentroom [3].roomnum = 202;
for (i = 0; i 16; i + +)
cln [i] = null; / * 清空床位 * /
for (i = 0; i 4; i + +)
for (j = 0, j 4; j + +)
studentroom [i].stu [j] = null; / * 清空学生信息 * /
for (n = 0,! feof (fp); n + +)
{
cln [n] = (a *) malloc (sizeof (student)); / * 动态分配一个student结构类型的空间给 cln [n] * /
if (fread (cln [n], sizeof (student), 1, fp) = = 0) / * 每次读入student结构类型大小的字节数到cln [n] * /
{
free (cln [n]); / * 如果不成功, 释放cln [n] 的内存空间, 合理利用空间 * /
break;
}
}
printf (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *);
printf (欢迎使用宿舍管理系统 \ n);
printf (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *);
return 1;
}
/ * 显示菜单界面 (柳维奎) * /
void hint (void)
{
printf (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
您可能关注的文档
- 江财会计硕士专业学位研究生培养方案(Training program of master degree of master's degree in Jiang Qian's accounting).doc
- 河南省各地区2009届高三期末调研语文卷精编名篇名句默写专题(The 2009 session of Henan Province three final research volume of Chinese fine special famous famous dictation).doc
- 沟通中的焦点在管理内or焦点在外(The focus of communication is management, and or is the focus).doc
- 沟通小故事(Communication story).doc
- 沟通,制定绩效指标的攻关员(Communicate with and develop key performance indicators).doc
- 河南省第四届acm程序设计大赛部分答案(Henan fourth acm programming contest part of the answer).doc
- 河南省郑州市2012届高三第一次质量预测(First quality prediction of the third high school of Zhengzhou in Henan Province in 2012).doc
- 河南省森林和野生动物类型自然保护区管理细则(Regulations for the management of nature reserves of forest and wildlife types in Henan Province).doc
- 活宝们在受难——空袭下的英国家畜(In the air under the clown suffer -- British livestock).doc
- 活用macd(Flexible MACD).doc
- 学会感恩主题活动策划(Learn to be grateful theme activities planning).doc
- 学生评语精选一(Student reviews).doc
- 学生踢球致伤应否承担侵权责任(Should students bear tort liability when playing football injuries).doc
- 学科素质教育的探索——马芯兰小学数学教学改革实验评介(Exploration of subject quality education -- review of the experimental teaching reform of mathematics in Ma Yuan primary school).doc
- 宣传文字(Propaganda text).doc
- 寻找企业核心力(Looking for core business).doc
- 学术论文格式(Academic paper format).doc
- 寻找属于自己的形管理与势(Looking for their own shape management and potential).doc
- 学设计必看的设计常识(Design must see the design common sense).doc
- 寻求当代中国发展的合理价值观念(Seeking the reasonable values of the development of contemporary China).doc
最近下载
- 八年级上名著《红岩》第10章(讲练测).docx VIP
- 表面处理技术在高端装备制造中的应用与挑战报告2025.docx
- 汪曾祺《钓鱼大夫》阅读答案试题解析理解 .pdf VIP
- 家庭反暴强制报告制度及服务流程.docx VIP
- 聚醚多元醇企业标准.pdf VIP
- 八年级上名著《红岩》第11章(讲练测).docx VIP
- T_CIATCM 093—2020_基层医疗卫生机构中医诊疗区(中医馆)团体标准远程会诊系统建设指南中国中医药信息学会.pdf VIP
- 八年级上名著《红岩》第12章(讲练测).docx VIP
- 2025国投生物制造创新研究院有限公司招聘(31人)考试备考试题及答案解析.docx VIP
- 边坡位移监测记录表.xlsx VIP
文档评论(0)