[求助] 希望各位C大大帮忙解答下......
有一班,3个学生,各学4门功课,计算第N个学生的成绩main()
{void average(float *p,int n);
void search(float (*p)[4],int n);
float score[3][4]={{65.67.70.60},{80,87,90,81},{90,99,100,98}};
average(*score,12);/*求12个学生平均成绩..*score传给形参是将什么传给P呢?/
search(score,2);/*第2个学生成绩 score传给形参是将什么传给行参呢?*/
}
void average(float *p,int n)
{float *p_end;
float sum=0,aver;
p_end=p+n-1;
for(;p<=p_end;p++)
sum=sum+(*p);
aver=sum/n;
printf("average=%f\n",aver);
}
void search(float (*p)[4],int n);
{int i;
for(i=0;i<4;i++)
printf("%f",*(*(p+n)+i));
}
原来明白些了,看多2次又糊涂了~~望各位大大慷慨解笔.......回答的越清晰越好....感激!!!