莫名其妙的错误
#include<stdio.h>#include<string.h>
main()
typedef struct
{char name[10]; \就是这行,奇怪了
int p;}stu;
{char a[10];
stu person[3]={{"白",0},{"李",0},{"木",0}};
int i,j;
for(i=0;i<10;i++)
{scanf("%3s",&a[i]);}
for(j=0;j<3;j++)
{if(stu person[j].name==a[i])
{stu person[j].p++;}}
for(j=0;j<3;j++)
printf("%s:%d\n",stu person[j].p);
return 0;}
C:\Users\Administrator\Desktop\type.cpp(5) : error C2143: syntax error : missing ';' before '<class-head>'
C:\Users\Administrator\Desktop\type.cpp(5) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
type.obj - 1 error(s), 0 warning(s)