Why this compiler error?

 

error is '++' - illegal assignment used

code is return(i++);

if change to i++;return(i); no error

editor help is

A return operator terminates the current function execution and returns the control to the calling program. A return(expression); operator terminates the current function execution with result transmission. The operator expression must be enclosed in parentheses and should not contain an assignment operator.

++ is increment operator and operators allowed in expression so why not allowed?

wat i missing?

edit

just had idea

is it because ++ is actually shorthand for i=i+1 ?

and this is the 'not contain an assignment operator' thing

 
fbj wrote >>

...is it because ++ is actually shorthand for i=i+1 ?

and this is the 'not contain an assignment operator' thing

Yes :)

 
thankyou - ok, I have confirm answer thankyou
Reason: