我是靠谱客的博主 深情大碗,最近开发中收集的这篇文章主要介绍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.2fn",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 SettingsAdministratorchengji.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 SettingsAdministratorchengji.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.

最后

以上就是深情大碗为你收集整理的c语言传参数过多出现问题,请高手看看一下程序怎么回事啊?老是提示传参数错误...的全部内容,希望文章能够帮你解决c语言传参数过多出现问题,请高手看看一下程序怎么回事啊?老是提示传参数错误...所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部