错误啥意思呀
hello.c: In function 'main':
hello.c:20:10: error: 'jR' undeclared (first use in this function) jR = joneResult(a, b, c); ^~ hello.c:20:10: note: each undeclared identifier is reported only once for each function it appears in
hello.c: In function 'main':
hello.c:20:10: error: 'jR' undeclared (first use in this function) jR = joneResult(a, b, c); ^~ hello.c:20:10: note: each undeclared identifier is reported only once for each function it appears in
2018-01-01
你全错了下面是正确代码,希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!希望采纳!
#include <stdio.h>
/* Jone算出结果应该怎么写函数? */
int joneResult(int x, int y, int z)
{
int sum = x+y+z;
return sum/3; //这里是不是应该将sum返回呢?
}
/* Jack没有算出结果只说了一句话是不是应该用无返回值函数? */
void jackResult(int x, int y, int z)
{
printf("我算不出来\n");
}
int main()
{
int a, b, c;
a = 10;
b = 20;
c = 30;
//Jone的返回值类型是什么?
int jR = joneResult(a, b, c);
printf("Jone运算结果是:%d\n", jR);
printf("Jack运算结果是:");
//Jack没有算出结果只说了句话,是不是直接调用函数就可以了?
jackResult(a, b, c);
return 0;
}举报