Lvalue required in function sign.sign是我自己定义的函数.int main(void){int x,y;int repeat,ri;scanf("%d",&repeat);for(ri = 1; ri 0)sign(x)=1;else { if (x==0)sign(x)=0;else sign(x)=-1;}return sign(x);} ..

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 19:32:15
Lvalue required in function sign.sign是我自己定义的函数.int main(void){int x,y;int repeat,ri;scanf(
xS]OP+%-ںnF/QF!JH&F1 "!X 9+WO[Ǘy

Lvalue required in function sign.sign是我自己定义的函数.int main(void){int x,y;int repeat,ri;scanf("%d",&repeat);for(ri = 1; ri 0)sign(x)=1;else { if (x==0)sign(x)=0;else sign(x)=-1;}return sign(x);} ..
Lvalue required in function sign.sign是我自己定义的函数.
int main(void)
{
int x,y;
int repeat,ri;
scanf("%d",&repeat);
for(ri = 1; ri 0)
sign(x)=1;
else { if (x==0)
sign(x)=0;
else sign(x)=-1;}
return sign(x);
}
..

Lvalue required in function sign.sign是我自己定义的函数.int main(void){int x,y;int repeat,ri;scanf("%d",&repeat);for(ri = 1; ri 0)sign(x)=1;else { if (x==0)sign(x)=0;else sign(x)=-1;}return sign(x);} ..
两个错误:
1.sign函数没有声明.(如果你把sign函数放在main函数前面就不必要声明)
2.“sign(x)=1;”这是相当有创意的想法,函数不能用等式来赋值,用一个参数代替,还有你在主函数中调用函数在认识上有错误,去看下课本吧,加油!