1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > c语言main调用函数 c语言 如何在main中调用函数

c语言main调用函数 c语言 如何在main中调用函数

时间:2024-06-03 19:08:03

相关推荐

c语言main调用函数 c语言 如何在main中调用函数

#include int main(){

char f;

float d = 0;

float i = 0;float y = 0;//定义两个用于储存输入数值的函数

printf("输入计算表达式,各项之间使用空格分开:\n");

scanf("%f%c%f\n",&i,&f,&y);

if(f = '+'){

d = jia(i,y);

}

printf("%f\n",d);

}

float jia(float a;float b;){

float z;

z = a + b;

return (z);

}

编译软件提示

167C:\Users\xiong\Desktop\计算器.c[Error] conflicting types for 'jia'

117C:\Users\xiong\Desktop\计算器.c[Note] previous implicit declaration of 'jia' was here

C:\Users\xiong\Desktop\计算器.cIn function 'jia':

186C:\Users\xiong\Desktop\计算器.c[Error] 'a' undeclared (first use in this function)

186C:\Users\xiong\Desktop\计算器.c[Note] each undeclared identifier is reported only once for each function it appears in

1810C:\Users\xiong\Desktop\计算器.c[Error] 'b' undeclared (first use in this function)

float jian(float a;float b;){

}

float chen(float a;float b;){

}

float chu(float a;float b;){

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。