| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2251 人关注过本帖
标题:C语言课程设计 用链表来做学生证管理系统 我不知道哪里错了
只看楼主 加入收藏
余米
Rank: 1
来 自:开平
等 级:新手上路
帖 子:13
专家分:1
注 册:2012-1-21
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:6 
C语言课程设计 用链表来做学生证管理系统 我不知道哪里错了
#include<stdio.h>
#include<string.h>
#include<malloc.h>
#include<stdlib.h>
#define N 100
#define LEN sizeof(struct student)



int n=0;

struct Class
{
    char College[20];                       //学院名;
    char Cname[20];                       //班名;
    char Cnu[20];                         //班号;
};
     


struct Student
{
    char Sname[20];                      //姓名;
    char Sex[10];                        //性别;
    int Snu;                        //学号;
    char SKahao[10];                     //卡号;
    int Age;                             //年龄;
    char Status[10];                     //身份;
    struct Class CInfo;                 //班级信息;
    struct Student * next;                //下个学生信息的地址;
}StuInfo[N];                            //用于临时储存学生信息;






void menu(struct Student * head);        //主菜单                  
void add(struct Student * head);          //添加模块
void modify(struct Student * head);       //修改模块
void Delete(struct Student * head);       //删除模块
void browse(struct Student * head);       //浏览模块
void quiry(struct Student * head);        //查询模块
void stastic(struct Student * head);       //统计模块
void bySname(struct Student * head);     //按姓名查询,子模块
void bySnu(struct Student * head);       //按学号查询,子模块
void byCnu(struct Student * head);       //按班号查询,子模块
void StuMsg(struct Student * head);      //返回全体学生统计信息,子模块
void Female(struct Student * head);      //女生统计信息,子模块
void Male(struct Student * head)        //男生统计信息,子模块
int FemaleNum(struct Student * head);    //返回女生人数,子函数
int MaleNum(struct Student * head);      //返回男生人数,子函数
int StuNum(struct Student * head);       //返回全体学生人数,子函数
struct Student * creat() ; //创造学生信息的链表;


int  main()
{
   struct Student * head;
   head=creat();
   menu(struct Student * head);
   getchar();
   return 0;
}



struct Student *creat()
{
    struct Student * head;
    struct Student * p1,* p2;
    n=0;
    p1=p2=(struct Student *)malloc(LEN);
    scanf("%s,%s,%d,%s,%d,%s,%s,%s,%s",&p1->Sname,&p1->Sex,&p1->Snu,&p1->SKahao,&p1->Age,&p1->Status,&p1->CInfo.College,&p1->,&p1->);
    head=NULL;
    while(p1->Snu!=0)
    {
        n=n+1;
        if(n==1)head=p1;
        else p2->next=p1;
        p2=p1;
        p1=(struct Student*)malloc(LEN);
        scanf("%s,%s,%d,%s,%d,%s,%s,%s,%s",&p1->Sname,&p1->Sex,&p1->Snu,&p1->SKahao,&p1->Age,&p1->Status,&p1->CInfo.College,&p1->,&p1->);
    }
    p2->next=NULL;
    return(head);
}





void menu(struct Student * head)
{
    int chose;
    int right;
    do
    {
        system("cls");               //清屏
        printf("\n\t\t\t\t欢迎登陆学生证管理系统!!!\n");
        printf(". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ");
        printf("  菜单:\t1-添加\t2-修改\t3-浏览全部\t4-查询\t5-统计\t6-删除\t7-退出\n");
        printf("········································");
        printf("请输入数字选择:");
        scanf("%d",&chose);
        if(chose<1||chose>8)
        {
           right=1;
           printf("输入错误,请重新输入!\n");
           getchar();
        }
        else right=0;
    }while(right==1);
    switch(chose)
    {
        case 1:add(struct Student * head);     break;            //添加模块
        case 2:modify(struct Student * head);  break;            //修改模块
        case 3:browse(struct Student * head);  break;            //浏览模块
        case 4:quiry(struct Student * head);    break;             //查询模块
        case 5:stastic(struct Student * head);   break;             //统计模块
        case 6:Delete(struct Student * head);   break;             //删除模块
        case 7:exit(0);                     //退出
    }
}




void add(struct Student * head)
{
  int num;
  int i;
  int age;
  char snu[20];
  char sex[20];
  char cnu[20];
  int right;
  struct Student * p0,* p1,* p2;

  FILE*fp;
  if((fp=fopen("StuInfo.txt","r+"))==NULL)    //以读写方式打开
   {
     if((fp=fopen("StuInfo.txt","w"))==NULL) //文件不存在则创建文件
     {
       printf("\n文件不存在且创建失败,返回!\n");
       menu();
     }
     printf("\n请按照提示输入学生信息:\n\n");
     printf("姓名:");
     scanf("%s",&StuInfo[n].Sname);
     do
     {
       printf("\n性别(男或女):");
       scanf("%s",sex);
       if((strcmp(sex,"男")!=0)&&(strcmp(sex,"女")!=0))
       {   
        printf("输入错误,请输入男或女!\n");
        right=1;
        getchar();
       }
       else right=0;
     }while(right==1);
     strcpy(StuInfo[n].Sex,sex);
     do
     {
       printf("\n年龄:");
       scanf("%d",&age);
       if(age<=0||age>100)
       {   
        printf("年龄应在0-100之间,请重新输入年龄!\n");
        right=1;
        getchar();
       }
       else right=0;
     }while(right==1);
     StuInfo[n].Age=age;
     do
     {
       printf("\n班号(1位):");
       scanf("%s",cnu);
       if(strlen(cnu)!=1)
       {   
        printf("输入错误,班号长度应为1位数!\n");
        right=1;
        getchar();
       }
       else right=0;
     }while(right==1);
     strcpy(StuInfo[n].,cnu);
     printf("\n班名:");
     scanf("%s",&StuInfo[n].);
     printf("\n学院:");
     scanf("%s",&StuInfo[n].CInfo.College);
     printf("\n身份:");
     scanf("%s",&StuInfo[n].Status);
     printf("\n卡号:");
     scanf("%s",&StuInfo[n].SKahao);
     printf("\n学号:");
     scanf("%d",&StuInfo[n].Snu);
  }


     p1=head;
     p0=StuInfor[n];

    if(head==NULL)
    {head=p0;p0->next=NULL;)
    else
    {
        while((p0->Snu>p1->Snu)&&(p1->next!=NULL))
        {
            p2=p1;
            p1=p1->next;
        }
        if(p0->Snu<=p1->Snu)
        {
            if(head==p1)head=p0;
            else p2->next=p0;
            p0->next=p1;
        }
        else
        {
            p1->next=p0;
            p0->next=NULL;
        }
    }


     fprintf(fp,"\n%s\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s",StuInfo[n].Sname,StuInfo[n].Sex,StuInfo[n].Snu,StuInfo[n].Age,StuInfo[n].,StuInfo[n].,StuInfo[n].CInfo.College,StuInfo[n].SKahao,StuInfo[n].Status);
     fclose(fp);
     n=n+1;
     printf("\n保存成功!\n");
     printf("\n请按enter键返回主菜单!\n");
     getchar();
     getchar();
     menu(struct Student * head);
}





void browse(struct Student * head)                            //显示所有学生信息
{
   int num;
   int i;
   FILE*fp;
   if((fp=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu(struct Student * head);
   }
   for(i=0;!feof(fp);i++)               //读取文件
   {      
     fscanf(fp,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
   }
   fclose(fp);
   num=i;
   printf("\n已添加%d个学生信息\n\n",num);
   printf("姓名     性别    学号      年龄   班号    班名   学院    卡号   身份\n");  
   for(i=0;i<num;i++)                   //输出
   {
    printf("%s  %s  %d  %d  %s  %s  %s  %s  %s\n",StuInfo[i].Sname,StuInfo[i].Sex,StuInfo[i].Snu,StuInfo[i].Age,StuInfo[i].,StuInfo[i].,StuInfo[i].CInfo.College,StuInfo[i].SKahao,StuInfo[i].Status);
   }
   printf("\n请按enter键返回主菜单!\n");
   getchar();
   getchar();
   menu(struct Student * head);
}




void quiry(struct Student * head)
{
    int chose;
    int right;
    do
    {
      system("cls");
      printf("\n\t1-按学号查询\t2-按姓名查询\t3-某班学生信息\t4-返回\n");  
      printf("\n请输入数字选择:");
      scanf("%d",&chose);
      if(chose<1||chose>4)
      {
        right=1;
        getchar();
      }
      else right=0;
    }while(right==1);
    switch(chose)
    {
        case 1:bySnu(struct Student * head);break;
        case 2:bySname(struct Student * head);break;
        case 3:byCnu(struct Student * head);break;
        case 4:menu(struct Student * head);   
    }  
}

void bySnu(struct Student * head)
{
  int found=-1;
  int num;
  int i;
  int nu;
  FILE*fp;
  if((fp=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu();
   }
  for(i=0;!feof(fp);i++)                 //读取文件
   {      
     fscanf(fp,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
   }
  num=i;
  fclose(fp);
  printf("\n请输入学生学号:");
  scanf("%d",nu);
  for(i=0;i<num;i++)
   {
     if(StuInfo[i].Snu==nu)
     {
         found=i;
         printf("\n该学生的信息为:\n\n");
         printf("姓名     性别    学号      年龄   班号    班名   学院    卡号   身份\n");         
         printf("%s\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s\n",StuInfo[found].Sname,StuInfo[found].Sex,StuInfo[found].Snu,StuInfo[found].Age,StuInfo[found].,StuInfo[found].,StuInfo[found].CInfo.College,StuInfo[found].SKahao,StuInfo[found].Status);
     }
     
  }
  if(found<0)
      printf("\n没有找到该班号的记录!\n");
  printf("\n请按enter键返回上级菜单!\n");
  getchar();
  getchar();
  quiry(struct Student * head);
}

void bySname(struct Student * head)
{
  int found=-1;
  int num;
  int i;
  char name[20];
  FILE*fp;
  if((fp=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu(struct Student * head);
   }
  for(i=0;!feof(fp);i++)                 //读取文件
   {      
     fscanf(fp,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
   }
  num=i;
  fclose(fp);
  printf("\n请输入学生姓名:");
  scanf("%s",name);
  printf("\n叫该姓名的学生信息为:\n\n");
  printf("姓名     性别    学号      年龄   班号    班名   学院    卡号   身份\n");
  for(i=0;i<num;i++)
   {
     if(strcmp(name,StuInfo[i].Sname)==0)
     {
       found=i;
       printf("%s\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s\n",StuInfo[found].Sname,StuInfo[found].Sex,StuInfo[found].Snu,StuInfo[found].Age,StuInfo[found].,StuInfo[found].,StuInfo[found].CInfo.College,StuInfo[found].SKahao,StuInfo[found].Status);
     }
  }
      
      
  
  if(found<0)
      printf("\n没有找到该班号的记录!\n");
  printf("\n请按enter键返回上级菜单!\n");
  getchar();
  getchar();
  quiry(struct Student * head);
}

void byCna(struct Student * head)
{
  int found=-1;
  int num;
  int i;
  char ClaNa[20];
  char ClaNu[20];
  FILE*fp;
  if((fp=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu(struct Student * head);
   }
  for(i=0;!feof(fp);i++)                 //读取文件
  {   
    fscanf(fp,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
  }
  num=i;
  fclose(fp);
  printf("\n请输入班名:");
  scanf("%s %s",ClaNa,ClaNu);
  printf("\n该班级的学生信息为:\n\n");
  printf("姓名     性别    学号      年龄   班号    班名   学院    卡号   身份\n");
  for(i=0;i<num;i++)
   {      
      if((strcmp(ClaNa,StuInfo[i].))&&(strcmp(ClaNu,StuInfo[i].))==0)
     {
      found=i;         
      printf("%s\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s\n",StuInfo[found].Sname,StuInfo[found].Sex,StuInfo[found].Snu,StuInfo[found].Age,StuInfo[found].,StuInfo[found].,StuInfo[found].CInfo.College,StuInfo[found].SKahao,StuInfo[found].Status);
     }
  }
  if(found<0)
      printf("\n没有找到该班号的记录!\n");
  printf("\n请按enter键返回上级菜单!\n");
  getchar();
  getchar();
  quiry(struct Student * head);
}





void Delete(struct Student * head)
{
  int num;
  int i;
  int found=-1;
  int StuNU;
  FILE*fpr,*fpw;
  if((fpr=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu(struct Student * head);
   }
  for(i=0;!feof(fpr);i++)                 //读取文件
   {      
     fscanf(fpr,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
   }
   num=i;
   fclose(fpr);
   printf("\n请输入学号选择你要删除的记录:");
   scanf("%d",StuNU);
   for(i=0;i<num;i++)
   {
     if(StuNU==StuInfo[i].Snu)
     {
         found=i;
         printf("\n你删除的学生信息为:\n\n");
         printf("姓名     性别    学号      年龄   班号    班名   学院    卡号   身份\n");      
         printf("%s\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s\n",StuInfo[found].Sname,StuInfo[found].Sex,StuInfo[found].Snu,StuInfo[found].Age,StuInfo[found].,StuInfo[found].,StuInfo[found].CInfo.College,StuInfo[found].SKahao,StuInfo[found].Status);
         if(found<num-1)
         {
           for(found;found<num-1;found++)
           {
             strcpy(StuInfo[found].Sname,StuInfo[found+1].Sname);
             strcpy(StuInfo[found].Sex,StuInfo[found+1].Sex);
             StuInfo[found].Snu==StuInfo[found+1].Snu;
             StuInfo[found].Age=StuInfo[found+1].Age;
             strcpy(StuInfo[found].,StuInfo[found+1].);
                strcpy(StuInfo[found].,StuInfo[found+1].);
             strcpy(StuInfo[found].CInfo.College,StuInfo[found+1].CInfo.College);
             strcpy(StuInfo[found].SKahao,StuInfo[found+1].SKahao);
             strcpy(StuInfo[found].Status,StuInfo[found+1].Status);
           }           
         }
         if((fpw=fopen("StuInfo.txt","w"))==NULL)
         {
          printf("文件打不开!\n");
          menu(struct Student * head);
         }
         for(i=0;i<num-1;i++)                   //保存文件
            {               
             fprintf(fpw,"\n%s\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s\n",StuInfo[found].Sname,StuInfo[found].Sex,StuInfo[found].Snu,StuInfo[found].Age,StuInfo[found].,StuInfo[found].,StuInfo[found].CInfo.College,StuInfo[found].SKahao,StuInfo[found].Status);
            }
         fclose(fpw);




         struct Student * p1,* p2;
         if(head==NULL)
         {
             printf("这是空表!!!!!!!!");
             exit(0);
         }


         p1=head;
         while(StuNU!=p1->Snu&&p1->next!=NULL)
         {
             p2=p1;
             p1=p1->next;
         }

         if(StuNU==p1->Snu)
         {
             if(p1==head)
                 head=p1->next;
             else
                 p2->next=p1->next;
             printf("delete:%d\n",StuNU);
             n=n-1;
         }
         else
             printf("%d not been found! \n",StuNU);
             exit(0);
     }


         printf("\n修改成功!\n");
         printf("\n请按enter键返回主菜单!\n");
         getchar();
         getchar();
         menu(struct Student * head);
     }     
   }
   if(found<0)
   {
      printf("\n没有找到该学号的记录:\n");
      printf("\n请按enter键返回主菜单!\n");
      getchar();
      getchar();
      menu(struct Student * head);
   }
}



void stastic(struct Student * head)
{
    int chose;
    int right;
    do
    {
      system("cls");
      printf("\n\t1-全体男生人数\t2-全体女生人数\t3-全体学生人数\t4-返回\n");  
      printf("\n请输入数字选择:");
      scanf("%d",&chose);
      if(chose<1||chose>4)
      {
        right=1;
        getchar();
      }
      else right=0;
    }while(right==1);
    switch(chose)
    {
        case 1:
            Male();
            printf("\n请按enter键返回上级菜单!\n");
            getchar();
            getchar();
            stastic(struct Student * head);
            break;
        case 2:
            Female();
            printf("\n请按enter键返回上级菜单!\n");
            getchar();
            getchar();
            stastic(struct Student * head);
            break;
        case 3:
            StuMsg();
            printf("\n请按enter键返回上级菜单!\n");
            getchar();
            getchar();
            stastic(struct Student * head);
            break;
        case 4:menu(struct Student * head);   
    }  
}


void Male(struct Student * head)                                //男生基本统计信息
{
   int num;
   num=MaleNum(struct Student * head);
   printf("\n男生总人数为:%d\n",num);
}

int MaleNum(struct Student * head)                             //男生人数
{
   int num;
   int count=0;
   int i;
   FILE*fp;
   if((fp=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu(struct Student *head);
   }
   for(i=0;!feof(fp);i++)               //读取文件
   {         
     fscanf(fp,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
   }
   fclose(fp);
   num=i;
   for(i=0;i<num;i++)                  
   {
       if(strcmp("男",StuInfo[i].Sex)==0)
       {
         count++;
       }
   }
   return count;
}





void Female(struct Student * head)                           //女生基本统计信息
{
   int num;
   num=FemaleNum(struct Student * head);
   printf("\n女生总人数为:%d\n",num);
}




int FemaleNum(struct Student * head)                          //女生人数
{
   int num;
   int count=0;
   int i;
   FILE * fp;
   if((fp=fopen("StuInfo.txt","r"))==NULL)
   {
     printf("文件打不开!\n");
     menu(struct Student * head);
   }
   for(i=0;!feof(fp);i++)               //读取文件
   {     
     fscanf(fp,"%s  %s  %d  %d  %s  %s  %s  %s  %s",&StuInfo[i].Sname,&StuInfo[i].Sex,&StuInfo[i].Snu,&StuInfo[i].Age,&StuInfo[i].,&StuInfo[i].,&StuInfo[i].CInfo.College,&StuInfo[i].SKahao,&StuInfo[i].Status);
   }
   fclose(fp);
   num=i;
   for(i=0;i<num;i++)                  
   {
       if(strcmp("女",StuInfo[i].Sex)==0)
       {
         count++;
       }
   }
   return count;
}




void StuMsg(struct Student * head)                        //全体学生基本统计信息
{
   int num;
   num=StuNum(struct Student * head);
   printf("\n学生总人数为:%d\n",num);
   Male(struct Student *head);
   Female(struct Student *head);
}

int StuNum(struct Student * head)                           //全体学生人数
{
   int num;
   num=MaleNum(struct Student *head)+FemaleNum(struct Student * head);
   return num;
}
搜索更多相关主题的帖子: 管理系统 设计 include 学生证 C语言 
2012-04-14 12:50
绿茶盖儿
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:1
帖 子:363
专家分:1852
注 册:2011-9-3
收藏
得分:4 
看着头疼,也不说你哪里有问题
2012-04-14 23:17
余米
Rank: 1
来 自:开平
等 级:新手上路
帖 子:13
专家分:1
注 册:2012-1-21
收藏
得分:0 
我怀疑链表部分有错,错误如下:D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(53) : error C2085: 'FemaleNum' : not in formal parameter list
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(54) : error C2085: 'MaleNum' : not in formal parameter list
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(55) : error C2085: 'StuNum' : not in formal parameter list
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(61) : error C2085: 'main' : not in formal parameter list
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(61) : error C2143: syntax error : missing ';' before '{'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(62) : error C2082: redefinition of formal parameter 'head'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(66) : warning C4098: 'Male' : 'void' function returning a value
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(76) : error C2027: use of undefined type 'student'
        D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(76) : see declaration of 'student'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(85) : error C2027: use of undefined type 'student'
        D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(76) : see declaration of 'student'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(207) : error C2065: 'StuInfor' : undeclared identifier
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(207) : error C2109: subscript requires array or pointer type
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(207) : warning C4047: '=' : 'struct Student *' differs in levels of indirection from 'int '
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(210) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(211) : error C2181: illegal else without matching if
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(246) : error C2143: syntax error : missing ';' before 'type'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(249) : error C2143: syntax error : missing ';' before 'type'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(250) : error C2275: 'FILE' : illegal use of this type as an expression
        d:\microsoft visual studio\vc98\include\stdio.h(156) : see declaration of 'FILE'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(343) : warning C4028: formal parameter 1 different from declaration
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(352) : warning C4047: 'function' : 'struct Student *' differs in levels of indirection from 'int '
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(352) : warning C4024: 'menu' : different types for formal and actual parameter 1
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(368) : error C2018: unknown character '0xa3'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(368) : error C2018: unknown character '0xbb'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(369) : error C2146: syntax error : missing ';' before identifier 'printf'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(380) : warning C4047: 'function' : 'struct Student *' differs in levels of indirection from 'int '
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(380) : warning C4024: 'quiry' : different types for formal and actual parameter 1
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(467) : warning C4553: '==' : operator has no effect; did you intend '='?
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(490) : error C2143: syntax error : missing ';' before 'type'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(498) : error C2065: 'p1' : undeclared identifier
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(498) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct Student *'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(499) : error C2223: left of '->Snu' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(499) : error C2223: left of '->next' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(501) : error C2065: 'p2' : undeclared identifier
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(502) : error C2223: left of '->next' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(505) : error C2223: left of '->Snu' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(507) : warning C4047: '==' : 'int ' differs in levels of indirection from 'struct Student *'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(508) : error C2223: left of '->next' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(510) : error C2223: left of '->next' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(510) : error C2223: left of '->next' must point to struct/union
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(527) : error C2059: syntax error : 'if'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(535) : error C2059: syntax error : '}'
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(585) : error C2084: function 'void __cdecl Male(struct Student *)' already has a body
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(587) : warning C4013: 'MaleNum' undefined; assuming extern returning int
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(625) : warning C4013: 'FemaleNum' undefined; assuming extern returning int
D:\Microsoft Visual Studio\COMMON\MSDev98\Bin\yumi123.c(665) : warning C4013: 'StuNum' undefined; assuming extern returning int
执行 cl.exe 时出错.
2012-04-15 11:49
陈ren
Rank: 2
等 级:论坛游民
帖 子:42
专家分:33
注 册:2012-2-29
收藏
得分:4 
回复 2楼 绿茶盖儿
这么长的程序,能不能分块检测呢?

老师说:死记硬背是一种很靠智商的方法,重要的还是努力
2012-04-15 14:39
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:4 
编译器已经给你指出哪里有错,连行号都有,你还问人哪里有错?

授人以渔,不授人以鱼。
2012-04-15 16:29
zwm123
Rank: 2
等 级:论坛游民
帖 子:8
专家分:20
注 册:2012-3-27
收藏
得分:4 
代码太长了
2012-04-15 23:38
haha11
Rank: 1
等 级:新手上路
帖 子:13
专家分:5
注 册:2012-4-14
收藏
得分:4 
受不了
2012-04-16 00:40
快速回复:C语言课程设计 用链表来做学生证管理系统 我不知道哪里错了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047661 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved