分享原创:简单的学生信息管理系统(C++版)
匆忙写的,似乎不是很完美。请大家多提宝贵意见。其中修改这个功能,在运行时出错,尚未发现问题出在哪?
请大家一起看看。
谢谢。
学生信息管理系统.zip
(442.36 KB)
if(!pointer) { cout<<"申请内存失败!"<<endl; exit(1); } cout<<"姓名:"; char name[20]; cin>>name; pointer->set_name(name); cout<<"性别:"; char sex[2]; cin>>sex; pointer->set_sex(sex); cout<<"年龄:"; int age; cin>>age; pointer->set_age(age); cout<<"学号:"; char stu_num[20]; cin>>stu_num; pointer->set_stu_num(stu_num); cout<<"年级:"; int grade; cin>>grade; pointer->set_grade(grade); cout<<"专业:"; char major[50]; cin>>major; pointer->set_major(major); cout<<"成绩:"<<endl; pointer->set_result(); fwrite(pointer,sizeof(ben_ke),1,fp1); delete pointer; pointer=NULL;