Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the Lvalue and Rvalue?

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


Please Help Members By Posting Answers For Below Questions

What is echo in c programming?

979


Why should I use standard library functions instead of writing my own?

1223


What is return type in c?

1089


Which is better between malloc and calloc?

1147


What is the use of bit field?

1148


why do some people write if(0 == x) instead of if(x == 0)?

1031


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1256


What is the size of enum in bytes?

1051


Explain what is a const pointer?

1055


What is the difference between a string and an array?

1175


What do you mean by invalid pointer arithmetic?

1025


What is the correct code to have following output in c using nested for loop?

1041


Write a factorial program using C.

1038


What is the difference between variable declaration and variable definition in c?

1037


Why we use conio h in c?

1172