麻烦大家看看这个程序,学生成绩
麻烦看看下面的错误,还有一些地方我也不大懂:#include "stdio.h"
#include "conio.h"
main()
{ void average(float *p,int n);
void search(float (*p),int n) //这两个地方有什么区别?
float score[3][4]={{65,67,70,60},{80,87,90,81},{90,99,100,98}};
average(*score,12);
search(score,2); //这两个的区别呢?
getch();
}
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=%5.2f\n",aver);
}
void search(float (*p)[4],int n)
{int i; //编译显示:与'search'声明中的类型不匹配?
printf("the score of No.%d are:\n",n);
for(i=0;i<4;i++)
printf("%5.2f",*(*(p+n)+i));
}