用结构体指针输出学生平均成绩和姓名 显示error C2100: illegal indirection为什么啊大神求解
#include<stdio.h>float aveScore(int a,int b,int c)
{
float ave;
ave=(a+b+c)/3.0;
return ave;
}
void main()
{
struct student
{
long snum[5];
char name[5];
int score[3];
float ave;
}s[6],*p=s;
int i;
printf("学号 姓名 programming database network\n");
for(i=0;i<6;i++,p++)
{
scanf("%d %s %d %d %d",&p->snum,&p->name,&p->score[0],&p->score[1],&p->score[2]);
*(p->ave)=aveScore(p->score[0],p->score[1],p->score[2]);
}
for(i=0;i<6;i++,p++)
{
printf("%s %f\n",*(p->name),*(p->ave));
}
}