Does "r- value" comes right of the assignment operator and "l- value" comes left of assignment operator or are they something more
1 Answers
l-value
refers to memory location which identifies an object. l-value may appear as either left hand or right hand side of an assignment operator(=). l-value often represents as identifier.
Expressions referring to modifiable locations are called “modifiable l-values“. A modifiable l-value cannot have an array type, an incomplete type, or a type with the const attribute. For structures and unions to be modifiable lvalues, they must not have any members with the const attribute. The name of the identifier denotes a storage location, while the value of the variable is the value stored at that location.
An identifier is a modifiable lvalue if it refers to a memory location and if its type is arithmetic, structure, union, or pointer. For example, if ptr is a pointer to a storage region, then *ptr is a modifiable l-value that designates the storage region to which ptr points.
r-value
refers to data value that is stored at some address in memory. A r-value is an expression that can’t have a value assigned to it which means r-value can appear on right but not on left hand side of an assignment operator(=).
https://www.geeksforgeeks.org/lvalue-and-rvalue-in-c-language/

- 23,228
- 4
- 34
- 43
-
Does "==" as in relational operator can have l value or value – HuHu Oct 06 '19 at 03:23
-
@user12153611 there's no assignment with `==`, so you may have any value on either side – lenik Oct 06 '19 at 03:24
-
Ok got the answer – HuHu Oct 06 '19 at 03:27
-
A reference in the C-Standard may help [C11 Standard - 6.3.2.1 Lvalues, arrays, and function designators](http://port70.net/~nsz/c/c11/n1570.html#6.3.2.1) See *Footnote (64)* for historical note. – David C. Rankin Oct 06 '19 at 03:27