when do we get an lvalue required error and an rvalue required error.
Printable View
when do we get an lvalue required error and an rvalue required error.
When you're damn unlucky! :)
if you try 5=5 you get an 'invalid lvalue in assignment'-like error, is it what you mean? it happens when the left side of an assignement is not...assignable (i.e. a variable).
I don't see any situation in which you would get the equivalent for an rvalue, as it would rather result in a syntax error...
What was the point of the question? any context?
A (modifiable) lvalue is required for assignment. If you have this = that; then this has to be an lvalue. There are no such things as rvalues in C, although sometimes people use it to mean "something that could be on the right-hand side of a assignment".