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
Why do we use & in c?
I have a varargs function which accepts a float parameter?
What is structure in c explain with example?
Write a program for Overriding.
What is floating point constants?
What are the different properties of variable number of arguments?
Why array is used in c?
What is the use of sizeof () in c?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is page thrashing?
What does *p++ do? What does it point to?
Explain how can you avoid including a header more than once?
What is a list in c?
Explain the advantages and disadvantages of macros.
How does selection sort work in c?