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
Under what circumstances does a name clash occur?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
can we have joblib in a proc ?
How can I manipulate strings of multibyte characters?
What are the primitive data types in c?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
praagnovation
can any one tel me wt is the question pattern for NIC exam
Is printf a keyword?
Why is not a pointer null after calling free?
What is keyword with example?
Explain what is the difference between a string and an array?
What is the size of empty structure in c?
How can a string be converted to a number?
Are global variables static in c?