结构体的数组声明问题!!
#include <stdio.h>struct stu{
char* name;
float cj;
char sex;
int bj;
}class[]={
{"liuming",78,'m',5},
{"zhangbo",98,'m',4},
{"duanyixuan",99,'f',1},
{"zhanglei",47,'m',3},
{"liutong",55,'m',3},
};
int main(void)
{
float pjcj=0;
int bujige=0;
int i;
for(i=0;i<5;i++)
{
pjcj+=class[i].cj;
if((class[i].cj)<60)
bujige++;
}
printf("pingjunchengji=%f\n bujigede=%d",pjcj,bujige);
return 0;
}不管怎么弄就是不能通过编译,请斑竹指教!!