• Error Type: LValue required

    We often get an error lvalue required?
    What is that?
    e.g
    when we write a code like this:


    int x=10;
    y=++x++;
    We get this type of error.
    What happens, first of all ++x is computed as (11) and then it will compute 11++, since 11 is constant and you are trying to increment it. 


    So first all all we should learn what does lvalue and rvalue means?






    L value :- is known at compile time. It says where to store the result.
    or value on left side. compiler allocated memory for left side only
    r value :-is not known until runtime. it is the value in itself. value on right side


    Lvalue is often known as left value and rvalue as right value.


    For more updates be a subscriber of this blog

0 comments:

Post a Comment