&是什么QUOT;左值需要与QUOT;在C编译器错误是什么意思? [英] What does "lvalue required" mean in a C compiler error?

查看:158
本文介绍了&是什么QUOT;左值需要与QUOT;在C编译器错误是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 #include<stdio.h>   //line 1
 #include<conio.h>   //line 2
 void main()         //line 3
 {                   //line 4
   int a=6,g=7,b=3;    //line 5
   clrscr();           //line 6
   printf("%d",a>?g=a:g=b); //line 7
   getch();                //line 8
 }

案例1:保存文件前

Case 1: before saving the file

这将在行中没有7'左值要求给出一个错误。但是,当我编译没有错误会来运行后,它产生输出3。

This will give an error at line no 7 'Lvalue required'. But when I compile no error will come and after running, it produced output 3.

案例2:保存文件后

而当我们保存这个文件,然后我们得到一个错误左值要求。

And when we save this file then we get an error "Lvalue required'.

对不起,在这里我的错误和问题写

sorry for my mistake and Write question here

 #include<stdio.h>   //line 1
    #include<conio.h>   //line 2
    void main()         //line 3
    {                   //line 4
    int a=6,g=7,b=3;    //line 5
    clrscr();           //line 6
    printf("%d",a>b?g=a:g=b); //line 7**
    getch();                //line 8
    }

案例1:保存文件前

Case 1: before saving the file

这将在行中没有7'左值要求给出一个错误。但是,当我编译没有错误会来运行后,它产生输出3。

This will give an error at line no 7 'Lvalue required'. But when I compile no error will come and after running, it produced output 3.

案例2:保存文件后

而当我们保存这个文件,然后我们得到一个错误左值要求。

And when we save this file then we get an error "Lvalue required'.

推荐答案

左值要求的意味着你不能赋值的东西,在内存中没有立足之地。基本上你需要一个变量能够分配一个值。

"Lvalue required" means you cannot assign a value to something that has no place in memory. Basically you need a variable to be able to assign a value.

在特定情况下,我会删除 A&GT; G =一:G = B 和更多的东西融为一体prehensible取代它,因为在当前的状态下没有人(包括你和你的编译器),有什么应该是任何丝毫的想法。

in your particular case I would remove a>g=a:g=b and replace it with something more comprehensible, because in the current state nobody (including you and your compiler) has any slightest idea what that's supposed to be.

这篇关于&是什么QUOT;左值需要与QUOT;在C编译器错误是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆