|
|
@ -35,7 +35,6 @@ void Deletestudent(); //ɾ
|
|
|
|
void yanshi(char *p); //延时函数说明
|
|
|
|
void yanshi(char *p); //延时函数说明
|
|
|
|
//**********************************************************************************************
|
|
|
|
//**********************************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
int count=0;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
yanshi("\n\n\n\t\t**************************欢迎使用学生信息管理系统*****************\n");
|
|
|
|
yanshi("\n\n\n\t\t**************************欢迎使用学生信息管理系统*****************\n");
|
|
|
@ -143,6 +142,7 @@ void Printstudent() //
|
|
|
|
{
|
|
|
|
{
|
|
|
|
system("cls");
|
|
|
|
system("cls");
|
|
|
|
system("color 1A");
|
|
|
|
system("color 1A");
|
|
|
|
|
|
|
|
int count=0;
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
printf("\t\t|\t\t\t欢迎使用湖南工业大学学生信息管理系统\t\t\t\t|\n");
|
|
|
|
printf("\t\t|\t\t\t欢迎使用湖南工业大学学生信息管理系统\t\t\t\t|\n");
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
@ -165,7 +165,7 @@ void Savestudent() //
|
|
|
|
system("cls");
|
|
|
|
system("cls");
|
|
|
|
system("color 1B");
|
|
|
|
system("color 1B");
|
|
|
|
FILE *fp;
|
|
|
|
FILE *fp;
|
|
|
|
fp=fopen("stu.dat","wb+"); //打开文件
|
|
|
|
fp=fopen("stu.dat","ab+"); //打开文件
|
|
|
|
if(fp==NULL)
|
|
|
|
if(fp==NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("打开文件失败!\n\n");
|
|
|
|
printf("打开文件失败!\n\n");
|
|
|
@ -316,7 +316,7 @@ void Readstudent() //
|
|
|
|
system("cls");
|
|
|
|
system("cls");
|
|
|
|
system("color 0F");
|
|
|
|
system("color 0F");
|
|
|
|
FILE *fp;
|
|
|
|
FILE *fp;
|
|
|
|
fp=fopen("stu.dat","rb");
|
|
|
|
fp=fopen("stu.dat","ab+");
|
|
|
|
if(fp==NULL)
|
|
|
|
if(fp==NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("打开文件失败!\n\n");
|
|
|
|
printf("打开文件失败!\n\n");
|
|
|
@ -324,11 +324,11 @@ void Readstudent() //
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//读取数据
|
|
|
|
//读取数据
|
|
|
|
node* p=phead; //当前节点
|
|
|
|
node* p=phead; //当前节点
|
|
|
|
while(p!=NULL)
|
|
|
|
fread(&p->stu,sizeof(student),1,fp);
|
|
|
|
|
|
|
|
while(!feof(fp))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fread(&p->stu,sizeof(student),1,fp);
|
|
|
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
p=p->pnext;
|
|
|
|
fread(&p->stu,sizeof(student),1,fp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fclose(fp);
|
|
|
|
fclose(fp);
|
|
|
|
printf("\n\n数据读取完毕!!!\n\n");
|
|
|
|
printf("\n\n数据读取完毕!!!\n\n");
|
|
|
@ -350,7 +350,7 @@ void Deletestudent() //ɾ
|
|
|
|
p=p->pnext;
|
|
|
|
p=p->pnext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(strcmp(p->stu.name,name)!=0)
|
|
|
|
if(strcmp(p->stu.name,name)==0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(p=phead)
|
|
|
|
if(p=phead)
|
|
|
|
{
|
|
|
|
{
|
|
|
|