编译没错误,连接出错unresolved external symbol
请各位大侠帮帮忙//求一个4*5矩阵第一列的平均数
#include<stdio.h>
int main()
{
float average_1(float(*a)[5]);
float a[4][5],average1;
int i,j;
for(i=0;i<4;i++)
printf("请输入第%d个学生的5门成绩:\n",i);
for(j=0;j<5;j++)
scanf("%f",&a[i][j]);
average1=average_1(a);
printf("第一门课程的平均分为:%f\n",average1);
return 0;
}
float average(float (*a)[5])
{
float sum=0;
int i;
for(i=0;i<5;i++)
sum=sum+**(a+i);
return sum/5;
}
Linking...
P292-15.obj : error LNK2001: unresolved external symbol "float __cdecl average_1(float (*)[5])" (?average_1@@YAMPAY04M@Z)
Debug/P292-15.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
P292-15.exe - 1 error(s), 0 warning(s)