there is
--foo++;
valid operator in C? (Will it compile / run) And is there any practical application for this?
Sorry to edit the question in the edit, but I found something.
According to my C ++ compiler (Visual Studio 2010):
--++foo;
is a valid team but
foo--++;
no. Is there a reason for this?
No, this is not true, because the result of increment / decment statements is not an lvalue.
EDIT: OP edited his question by adding two more examples. So, let's go for the same reason:
--++foo; --foo++; foo--++;
- , increment/decment lvalue. , - .
C, , .
- ++ Foo;
ok : -
++ Foo;
,
, pre increment foo foo + 1.
foo = foo + 1;
foo ( , ).
- (++ Foo);
- ( );// foo + 1
value = constant_valu + 1;// ,
.
-d So lvalue