user-0 提问: 在编译函数的时候会有"声明类型太多"的错误报告是什么意思？？？求解答啊啊啊啊 

回复:
user: user-1
content: 引用 8 楼 u013326388 的回复:文件这样做，对吗？？想问 ？？？

user: user-0
content: 文件这样做，对吗？？想问

user: user-2
content: 偶遇到类似问题都是用 “每次用/*...*/注释掉不同部分再重新编译，直到定位到具体语法出错的位置。” 的方法解决的。

user: user-1
content: struct stu                                                                   /*struct*/ {  char *name;  int sex;  char *class;  char number[10];  int math_score;  int English_score;  int c_score;  char *native;  char *math_teacher;  char *English_teacher;  char *c_teacher;  char *classroom;  char *time; }  楼主，分号呢？ struct stu { ... };

user: user-0
content: case 8:                   do                   {                    printf("please input the native:"); 	           gets(p);                    q=student[0].native; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 9:                   do                   {                    printf("please input the math_teacher:"); 	           gets(p);                    q=student[0].math_teacher; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 10:                   do                   {                    printf("please input the English_teacher:"); 	           gets(p);                    q=student[0].English_teacher; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 11:                   do                   {                    printf("please input the c_teacher:"); 	           gets(p);                    q=student[0].c_teacher; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 12:                   do                   {                    printf("please input the classroom:"); 	           gets(p);                    q=student[0].classroom; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 13:                   do                   {                    printf("please input the time:"); 	           gets(p);                    q=student[0].time; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;           default:          }          if(m==10)break;          printf("Do you want to search once?");          printf("1.Yes\n2.no\n");          scanf("%d",&j);          while(j!=1&&j!=2)          {           printf("Error;please input again:");           scanf("%d",&j);          }         }while(j==1);         break;    case 3:       do       {        clrscr();        printf("Which score's reorder do you want to know ?");        printf("1.math_score");        printf("2.English_score");        printf("3.c_score");        scanf("%d",&m);        while(m!=1&&m!=2&&m!=3)        {         printf("Error;please input again:");         scanf("%d",&m);        }        switch(m)        {         case 1:p=&student[0].math_score;break;         case 2:p=&student[0].English_score;break;         case 3:p=&student[0].c_score;break;         default:printf("No this kind of message!");break;        }        if((fp=fopen("F:\\stud.data","r"))==NULL)        {         printf("\nerror on open F:\\stud.data!");         getchar();         exit(1);        }        n=ftell(f)/sizeof(struct stu);        for(i=0,b=0;i<n-1;i++)        {         for(j=1;j<n;j++)          if(*(p+b)<*(p+j))b=j;         fscanf(f,"%s%d%s%s",student[i].name,&student[i].sex,student[i].class,student[i].number);         fscanf(f,"%d%d%d",&student[i].math_score,&student[i].English_score,&student[i].c_score);         fscanf(f,"%s%s%s",student[i].native,student[i].math_teacher,student[i].English_teacher);         fscanf(f,"%s%s%s",student[i].c_teacher,student[i].classroom,student[i].time);         fscanf(f,"%s%d%s%s",student[b].name,&student[b].sex,student[b].class,student[b].number);         fscanf(f,"%d%d%d",&student[b].math_score,&student[b].English_score,&student[b].c_score);         fscanf(f,"%s%s%s",student[b].native,student[b].math_teacher,student[b].English_teacher);         fscanf(f,"%s%s%s",student[b].c_teacher,student[b].classroom,student[b].time);          strcpy(student1.name,student[b].name);strcpy(student[b].name,student[i].name);strcpy(student[i].name,student1.name);         student1.sex=student[b].sex;student[b].sex=student[i].sex;student[i].sex=student1.sex;         strcpy(student1.class,student[b].class);strcpy(student[b].class,student[i].class);strcpy(student[i].class,student1.class);         strcpy(student1.number,student[b].number);strcpy(student[b].number,student[i].number);strcpy(student[i].number,student1.number);         student1.math_score=student[b].math_score;student[b].math_score=student[i].math_score;student[i].math_score=student1.math_score;         student1.English_score=student[b].English_score;student[b].English_score=student[i].English_score;student[i].English_score=student1.English_score;         student1.c_score=student[b].c_score;student[b].c_score=student[i].c_score;student[i].c_score=student1.c_score;         strcpy(student1.native,student[b].native);strcpy(student[b].native,student[i].native);strcpy(student[i].native,student1.native);         strcpy(student1.math_teacher,student[b].math_teacher);strcpy(student[b].math_teacher,student[i].math_teacher);strcpy(student[i].math_teacher,student1.math_teacher);         strcpy(student1.English_teacher,student[b].English_teacher);strcpy(student[b].English_teacher,student[i].English_teacher);strcpy(student[i].English_teacher,student1.English_teacher);         strcpy(student1.c_teacher,student[b].c_teacher);strcpy(student[b].c_teacher,student[i].c_teacher);strcpy(student[i].c_teacher,student1.c_teacher);         strcpy(student1.classroom,student[b].classroom);strcpy(student[b].classroom,student[i].classroom);strcpy(student[i].classroom,student1.classroom);         strcpy(student1.time,student[b].time);strcpy(student[b].time,student[i].time);strcpy(student[i].time,student1.time);        }         printf("Which ranking do you want to know ?\n");        printf("please input the ranking:");        scanf("%d\n",&v);        while(v>n)        {         printf("Error;please input again:");         scanf("%d",&v);        }        printf("%s\n",student[v-1].name);        switch(student[v-1].sex)        {         case 1:printf("man\n");break;         case 2:printf("woman\n");break;         default:break;        }        printf("%s\n",student[v-1].class);        printf("%s\n",student[v-1].number);        printf("%d\n",student[v-1].math_score);        printf("%d\n",student[v-1].English_score);        printf("%d\n",student[v-1].c_score);        printf("%s\n",student[v-1].native);        printf("%s\n",student[v-1].math_teacher);        printf("%s\n",student[v-1].English_teacher);        printf("%s\n",student[v-1].c_teacher);        printf("%s\n",student[v-1].classroom);        printf("%s\n",student[v-1].time);         fprintf(f,"%s%d%s%s",student[i].name,student[i].sex,student[i].class,student[i].number);        fprintf(f,"%d%d%d",student[i].math_score,student[i].English_score,student[i].c_score);        fprintf(f,"%s%s%s",student[i].native,student[i].math_teacher,student[i].English_teacher);        fprintf(f,"%s%s%s",student[i].c_teacher,student[i].classroom,student[i].time);        fprintf(f,"%s%d%s%s",student[b].name,student[b].sex,student[b].class,student[b].number);        fprintf(f,"%d%d%d",student[b].math_score,student[b].English_score,student[b].c_score);        fprintf(f,"%s%s%s",student[b].native,student[b].math_teacher,student[b].English_teacher);        fprintf(f,"%s%s%s",student[b].c_teacher,student[b].classroom,student[b].time);         fclose(fp);        printf("Do you want to do it once?");        printf("1.Yes\n2.no\n");        scanf("%d",&j);        while(j!=1&&j!=2)        {         printf("Error;please input again:");         scanf("%d",&j);        }       }while(j==1);       break;

user: user-0
content: do           {            printf("What do you search for?");            printf("*******************STUDENT'S STUDY SYSTEM************\n\n");            printf("                        1.name\n");            printf("                        2.sex\n");            printf("                        3.class\n");            printf("                        4.number\n");            printf("                        5.math_score\n");            printf("                        6.English_score\n");            printf("                        7.c_score\n");            printf("                        8.native\n");            printf("                        9.math_teacher\n");            printf("                        10.English_teacher\n");            printf("                        11.c_teacher\n");            printf("                        12.classroom\n");            printf("                        13.time\n");            printf("                        14.back\n");            printf("please input the key's number:");            scanf("%d",&m);            while(m<1||m>14)            {             printf("Error;please input again:");             scanf("%d",&m);            }            switch(m)            {             case 1:                    do                    {                     printf("please input the name:"); 	            gets(p);                     q=student[0].name; 	            search_s(q,fp,p,student[num]);                                                  /*search*/                     printf("Do you want to do it once?");                     printf("1.Yes\n2.no\n");                     scanf("%d",&j);                     while(j!=1&&j!=2)                     {                      printf("Error;please input again:");                      scanf("%d",&j);                     }                    }while(j==1);                    break;            case 2:                   do                   {                    printf("please input the sex:");                    scanf("%d",&v);                    if(v!=1&&v!=2)                    {                     printf("error,1.man\t2.woman");                     printf("please input again:");                     scanf("%d",&v);                    }                    seacher_i(&student[0].sex,fp,v,student[num]);                                                 /*search_i*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 3:                   do                   {                    printf("please input the class:"); 	           gets(p);                    q=student[0].class; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 4:                   do                   {                    printf("please input the number:"); 	           gets(p);                    q=student[0].number; 	           search_s(q,fp,p,student[num]);                                                  /*search*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 5:                   do                   {                    printf("please input the math_score:");                    scanf("%d",&v);                    while(v<0||v>100)                    {                     printf("error:0=<v=<100");                     printf("please input again:");                     scanf("%d",&v);                    }                    seacher_i(&student[0].math_score,fp,v,student[num]);                                          /*seach_i*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 6:                   do                   {                    printf("please input the English_score:");                    scanf("%d",&v);                    while(v<0||v>100)                    {                     printf("error:0=<v=<100");                     printf("please input again:");                     scanf("%d",&v);                    }                    seacher_i(&student[0].English_score,fp,v,student[num]);                              /*seach_i*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;            case 7:                   do                   {                    printf("please input the c_score:");                    scanf("%d",&v);                    while(v<0||v>100)                    {                     printf("error:0=<v=<100");                     printf("please input again:");                     scanf("%d",&v);                    }                    seacher_i(&student[0].c_score,fp,v,student[num]);                                 /*seach_i*/                    printf("Do you want to do it once?");                    printf("1.Yes\n2.no\n");                    scanf("%d",&j);                    while(j!=1&&j!=2)                    {                     printf("Error;please input again:");                     scanf("%d",&j);                    }                   }while(j==1);                   break;                   j++;                  }                 }                 if(j==0)printf("no this kind of message!");                 break;          case 2:                 for(i=0,j=0;i<n;i++)                 {                  fscanf(f,"%s%d%s%s",student[i].name,&student[i].sex,student[i].class,student[i].number);                  fscanf(f,"%d%d%d",&student[i].math_score,&student[i].English_score,&student[i].c_score);                  fscanf(f,"%s%s%s",student[i].native,student[i].math_teacher,student[i].English_teacher);                  fscanf(f,"%s%s%s",student[i].c_teacher,student[i].classroom,student[i].time);                  *student2[0].class=*student[0].class;                  if(strcmp(tname,p+i)==0)                  {                   for(b=0,v=0;b=<j;b++)                   {                    if(strcmp(student2[b].class,student[i].class)==0)v++;                   }                   if(v==0)                   {                    printf("%s\n",student[i].class);                    j++;                    *student2[j].class=*student[i].class;                   }                  }                 }                 if(j==0)printf("no this kind of message!");                 break;

user: user-0
content: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> #define num 100  struct stu                                                                   /*struct*/ {  char *name;  int sex;  char *class;  char number[10];  int math_score;  int English_score;  int c_score;  char *native;  char *math_teacher;  char *English_teacher;  char *c_teacher;  char *classroom;  char *time; }  struct stu *input(struct stu *student,FILE *f) {   int i,n;   char ch;   if((f=fopen("F:\\stud.data","wt+"))==NULL)   {    printf("\nerror on open F:\\stud.data!");    getchar();    exit(1);   }    do   {    clrscr();    i=0;    printf("please input the student's messages:\n");    printf("name:");    gets(student[i].name);    printf("sex:\n");    printf("1.man\n2.woman\n");    scanf("%d",&student[i].sex);    if(student[i].sex!=1&&student[i].sex!=2)    do    {        printf("\nerror,1.man\t2.woman\n");        printf("please input again:");        scanf("%d",&student[i].sex);        getchar();    }while(student[i].sex!=1&&student[i].sex!=2);    printf("\nclass:");    gets(student[i].class);    getchar();    printf("\nnumber:");    scanf("%s",student[i].number);    while(strlen(student[i].number)!=10)    {         printf("\nerror,please input the right data:");         gets(student[i].number);         getchar();    };    if(i>0)    {     for(n=0;n<i;n++)     {      if(strcmp(student[n].number,student[i].number)==0)      {         printf("\nerror,please input the right data:");         gets(student[i].number);         getchar();      }     }    }    printf("\nmath_score:");    scanf("%d",&student[i].math_score);    if(student[i].math_score>100||student[i].math_score<0)    do    {         printf("\nerror,please input the right math_score:");         scanf("%d",&student[i].math_score);    }while(student[i].math_score>100||student[i].math_score<0);    printf("\nEnglish_score:");    scanf("%d",&student[i].English_score);    if(student[i].English_score>100||student[i].English_score<0)    do    {         printf("\nerror,please input the right English_score:");         scanf("%d",&student[i].English_score);    }while(student[i].English_score>100||student[i].English_score<0);    printf("\nc_score:");    scanf("%d",&student[i].c_score);    if(student[i].c_score>100||student[i].c_score<0)    do    {         printf("\nerror,please input the right c_score:");         scanf("%d",&student[i].c_score);    }while(student[i].c_score>100||student[i].c_score<0);    printf("\nnative:");    gets(student[i].native);    getchar();    printf("\nmath_teacher:");    gets(student[i].math_teacher);    getchar();    printf("\nEnglish_teacher:");    gets(student[i].English_teacher);    getchar();    printf("\nc_teacher:");    gets(student[i].c_teacher);    getchar();    printf("\nclassroom:");    gets(student[i].classroom);    getchar();    printf("\ntime:");    gets(student[i].time);    fwrite(&student[i],sizeof(struct stu),1,f);    i++;    printf("Have another student record(y/n)?");    ch=getchar();    getchar();   }while(ch=='Y'||ch=='y');  fclose(f);  return(student); }  struct stu *add(struct stu *student,FILE *f) {   int i,n;   char ch;   if((f=fopen("F:\\stud.data","at+"))==NULL)   {    printf("\nerror on open F:\\stud.data!");    getchar();    exit(1);   }    do   {    clrscr();    i=ftell(f)/sizeof(struct stu);    n=ftell(f);    fseek(f,n,0);    printf("please add the student's messages:\n");    printf("name:");    gets(student[i].name);    printf("sex:\n");    printf("1.man\n2.woman\n");    scanf("%d",&student[i].sex);    if(student[i].sex!=1&&student[i].sex!=2)    do    {        printf("\nerror,1.man\t2.woman\n");        printf("please input again:");        scanf("%d",&student[i].sex);        getchar();    }while(student[i].sex!=1&&student[i].sex!=2);    printf("\nclass:");    gets(student[i].class);    getchar();    printf("\nnumber:");    scanf("%s",student[i].number);    while(strlen(student[i].number)!=10)    {         printf("\nerror,please input right data:");         gets(student[i].number);    };    printf("\nmath_score:");    scanf("%d",&student[i].math_score);    if(student[i].math_score>100||student[i].math_score<0)    do    {         printf("\nerror,please input the right math_score:");         scanf("%d",&student[i].math_score);    }while(student[i].math_score>100||student[i].math_score<0);    printf("\nEnglish_score:");    scanf("%d",&student[i].English_score);    if(student[i].English_score>100||student[i].English_score<0)    do    {         printf("\nerror,please input the right English_score:");         scanf("%d",&student[i].English_score);    }while(student[i].English_score>100||student[i].English_score<0);    printf("\nc_score:");    scanf("%d",&student[i].c_score);    if(student[i].c_score>100||student[i].c_score<0)    do    {         printf("\nerror,please input the right c_score:");         scanf("%d",&student[i].c_score);    }while(student[i].c_score>100||student[i].c_score<0);    printf("\nnative:");    gets(student[i].native);    getchar();    printf("\nmath_teacher:");    gets(student[i].math_teacher);    getchar();    printf("\nEnglish_teacher:");    gets(student[i].English_teacher);    getchar();    printf("\nc_teacher:");    gets(student[i].c_teacher);    getchar();    printf("\nclassroom:");    gets(student[i].classroom);    getchar();    printf("\ntime:");    gets(student[i].time);    fwrite(&student[i],sizeof(struct stu),1,f);    i++;    printf("Have another student record(y/n)?");    ch=getchar();    getchar();   }while(ch=='Y'||ch=='y');  fclose(f);  return(student); }  void search_s(char *q,FILE *f,char *p,struct stu student) {   int i,n,m;   if((f=fopen("F:\\stud.data","r"))==NULL)   {    printf("\nerror on open F:\\stud.data!");    getchar();    exit(1);   }   n=ftell(f)/sizeof(struct stu);   for(i=0,m=0;i<n;i++)   {    fscanf(f,"%s",q);                                   /*q is the first.*/    if(strcmp(q+i,p)==0)    {     fscanf(f,"%s%d%s%s",student[i].name,&student[i].sex,student[i].class,student[i].number);     fscanf(f,"%d%d%d",&student[i].math_score,&student[i].English_score,&student[i].c_score);     fscanf(f,"%s%s%s",student[i].native,student[i].math_teacher,student[i].English_teacher);     fscanf(f,"%s%s%s",student[i].c_teacher,student[i].classroom,student[i].time);     printf("%s\t\n",student[i].name);     switch(student[i].sex)     {      case 1:printf("man\n");break;      case 2:printf("woman\n");break;      default:break;     }     printf("%s\n",student[i].class);     printf("%s\n",student[i].number);     printf("%d\n",student[i].math_score);     printf("%d\n",student[i].English_score);     printf("%d\n",student[i].c_score);     printf("%s\n",student[i].native);     printf("%s\n",student[i].math_teacher);     printf("%s\n",student[i].English_teacher);     printf("%s\n",student[i].c_teacher);     printf("%s\n",student[i].classroom);     printf("%s\n",student[i].time);     m++;    }   if(m==0)printf("no this kind of message!");   }   fclose(f); }  void search_i(int *q,FILE *f,int p,struct stu student[]) {   int i,n,m;   if((f=fopen("F:\\stud.data","r"))==NULL)   {    printf("\nerror on open F:\\stud.data!");    getchar();    exit(1);   }   n=ftell(f)/sizeof(struct stu);   for(i=0,m=0;i<n;i++)   {    fscanf(f,"%d",q);                              /*q is the first.*/    if(*q==p)    {     fscanf(f,"%s%d%s%s",student[i].name,&student[i].sex,student[i].class,student[i].number);     fscanf(f,"%d%d%d",&student[i].math_score,&student[i].English_score,&student[i].c_score);     fscanf(f,"%s%s%s",student[i].native,student[i].math_teacher,student[i].English_teacher);     fscanf(f,"%s%s%s",student[i].c_teacher,student[i].classroom,student[i].time);     printf("%s\t\n",student[i].name);     switch(student[i].sex)     {      case 1:printf("man\n");break;      case 2:printf("woman\n");break;      default:break;     }     printf("%s\n",student[i].class);     printf("%s\n",student[i].number);     printf("%d\n",student[i].math_score);     printf("%d\n",student[i].English_score);     printf("%d\n",student[i].c_score);     printf("%s\n",student[i].native);     printf("%s\n",student[i].math_teacher);     printf("%s\n",student[i].English_teacher);     printf("%s\n",student[i].c_teacher);     printf("%s\n",student[i].classroom);     printf("%s\n",student[i].time);     m++;    }   if(m==0)printf("No this kind of message!");   }   fclose(f); }  main()                                                                      /*main*/ {  int a,b;  struct stu student[num],student1,student2[num];  int i,m,v,n,j;  char *p,*q,ch;  char tname[20];  FILE *fp;  do  {   clrscr();   printf("*******************STUDENT'S STUDY SYSTEM************\n\n");   printf("                     1.data's inputing\n");   printf("                     2.key words' searching\n");   printf("                     3.scores' reorder\n");   printf("                     4.teacher's messages\n");   printf("                     5.classroom's messages\n");   printf("                     6.exit\n");   printf("which function do you want ?");   scanf("%d",&a);   while(a<1||a>6)   {    printf("Error;please input again:");    scanf("%d",&a);   }   switch(a)   {    case 1:           do           {            printf("Do you want add some messages to it ?\nY\t\tN\n");            if(getchar()=='Y'||getchar()=='y')              add(student[num],fp);                                                    /*add*/            else              {               input(student[num],fp);                                                    /*input*/              }            printf("Do you want to do it once?");            printf("1.Yes\n2.no\n");            scanf("%d",&j);            while(j!=1&&j!=2)            {             printf("Error;please input again:");             scanf("%d",&j);            }           }while(j==1);           break;    case 2:

user: user-1
content: 最好把报错的内容也贴上来

user: user-3
content: struct stu 定义传上来，另外其它相关的也传上来