Hi,
What are the l values and r values using in the C statement, How compiler is using these?
Specially with the pointers.
Is there any link which describe the concept of L-value and R-value related to C?
Thanks
Bhupesh
Hi,
What are the l values and r values using in the C statement, How compiler is using these?
Specially with the pointers.
Is there any link which describe the concept of L-value and R-value related to C?
Thanks
Bhupesh
You can probably do a google search to find an article which explains this in detail. In basic terms though, an L-Value is something that can appear on the left side of an equals sign, and R-Values are everything else. There are exceptions to this rule (const objects are L-Values), but it holds true for the most part.
http://msdn2.microsoft.com/en-us/library/bkbs2cds.aspx
Hi...thanx for the reply...
i have gone through msdn link also, still didnt get properly.
what are the rules for that?
Regards
Bhupesh
Code:# define EVERYTHINK 0 int main ( void ) { while ( C_learning ) english_learning ( ); return EVERYTHINK; }
The basic rule is: anything that results in a "single variable" (so, not an array) that can be assigned a new value is an Lvalue.
Lvalues is what end up on the left on an assignment, and when the compiler says "not an lvalue", it means, strictly, that it's "not something it can assign a new value to".
I'm not sure if this explains it any better than the above links, but if it's still not clear, can you perhaps explain what exactly it is you don't understand.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.