Understand lvalue and rvalue in C ..

Home Forums C-programming.. Understand lvalue and rvalue in C ..

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2126 Reply
    Humble
    Keymaster

    lvalue :

    There are 2 interpretations for lvalue and those are

    1) locator value
    2) Left hand side value

    Any of the above will do, but its where the value is getting stored.. lvalue can be again divided into 2 forms .. modifiable or unmodifiable value..

    Unmodifiable lvalues :
    For ex: arrays, ‘const’ variables, An object is a structure or union type and one of its members has a const-qualified type

    rvalue

    Can be interpreted as right hand side value . its the value getting assigned or read in an expression.

    Some operators require lvalues for some of their operands.
    The operands must be lvalues.

    For ex:

    1) &
    2) ++
    3) —

    For some others, Left operand must be an lvalue.

    = += -= *= %= <<= >>= &= ^= |=


    All lvalues are rvalues but all rvalues are not lvalues.

    #2271 Reply
    Humble
    Keymaster
    This reply has been marked as private.
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Understand lvalue and rvalue in C ..
Your information: