0
Is this code correct or not
1 Answer
+ 2
in simple words
you cant apply decrement on rvalue.
by rvalue i mean something which evaluates to expression which dont have an identifier.
like
int x=0;
int y=--x; //valid since x is lvalue
y=--5; // invalid since 5 is rvalue
aside : [many say rvalue is something which doesn't have a memory address but its wrong , as every single constant expression has memory address associated with it , its that there's no simple way to know its memory address, i.e you will find rvalue in final compiled binary so it must live somewhere in memoy ]