Answer Posted / vadivel t
Simple definitions:
Lvalue - is value which can be modified(it cannot be a
constant). And it can act as Rvalue too.
Rvalue - is value which can be able to fetch from the
memory, propably a constant. It can also act as Lvalue(if
it is not a constant).
Dont be confused... Lets hav example.
Example:
int a = 0, b = 10;
1.Rvalue
if(a)
{
...
...
...
}
here a is RValue(cos, as per definition, the value is able
to fetch from the memory)
2.One variable acting as L and R value
a = a + b;
here a + b; evaluated fist.. lets analise...
First a and b has to be fetched from the memory, by this
time, both will act as a Rvalue(as per definition)....
then a + b result shall be assigned to 'a'. Now 'a' will be
acting as a Lvalue. Cos u able to modify it...
So here 'a' can act as L as well as R value depends on the
situation.
3.a = 10;
Here 10 is Rvalue and 'a' ll act as Lvalue.
Hope u understand clearly.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What is echo in c programming?
Why should I use standard library functions instead of writing my own?
What is return type in c?
Which is better between malloc and calloc?
What is the use of bit field?
why do some people write if(0 == x) instead of if(x == 0)?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
What is the size of enum in bytes?
Explain what is a const pointer?
What is the difference between a string and an array?
What do you mean by invalid pointer arithmetic?
What is the correct code to have following output in c using nested for loop?
Write a factorial program using C.
What is the difference between variable declaration and variable definition in c?
Why we use conio h in c?