[strong]on executing the below program i got error message like required Lvalue is missing in main function[/strong]
[strong] main() [/strong]
[strong]{[/strong]
[strong] int i;[/strong]
[strong] printf("%d",++i++); [/strong]
[strong]} [/strong]
[strong]plz tell me what are rvalues and lvalues. if there are any other values of this kind plz explain me that also[/strong]
Software/Hardware used:
Turbo c++/ visual c++
ASKED:
September 3, 2010 12:51 PM
UPDATED:
September 21, 2010 12:38 PM
i++ means to increment the variable after use
++i means to increment it before using
either way, as Carlosdl says, you cannot do both in a single command.
thank you for your reply sir,
I have one major doubt
is it correct to say that a l value is a super-set of r-value
“is it correct to say that a l value is a super-set of r-value”
I don’t think so.
Rather, I would say that r-values are a superset of l-values, because all l-values are r-values, but not vice versa.
ya right now I got it,
(up to my knowledge)
r-values are values that are on the right hand side and they can be a variable (pointing a location in memory) or it can be just a value(a number or character)
but only a variable pointing to the memory location can be a l-value
thank you sir, for your kind reply