c语言传入参数不正确,请高手看看一下程序怎么回事啊?老是提示传参数错误...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#include

void main()

{ void average(float, int);

void search(float,int);

static float score[][4]={{65,67,70,60},{80,87,90,81},{99,90,100,98}};

average(score,12);

search(score,2);

}

void average(float *p,int n)

{

float *p_end,sum;

sum=0;

p_end=p+n;

while(p

printf("average=%5.2f\n",sum/n);

}

void search(float(*p)[4] ,int n)

{ int i;

printf("The score of NO %d are:\n",n+1);

for(i=0;i<4;i++)

printf("%5.2f",*(*(p+n)+i));

}

以下是错误信息,环境是VC++6.0

C:\Documents and Settings\Administrator\chengji.cpp(7) : error C2664: 'average' : cannot convert parameter 1 from 'float [3][4]' to 'float'

There is no context in which this conversion is possible

C:\Documents and Settings\Administrator\chengji.cpp(8) : error C2664: 'search' : cannot convert parameter 1 from 'float [3][4]' to 'float'

There is no context in which this conversion is possible

Error executing cl.exe.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值