Search code examples
c#cpost-incrementpre-increment

Why can't I do ++i++ in C-like languages?


Half jokingly half serious : Why can't I do ++i++ in C-like languages, specifically in C#?

I'd expect it to increment the value, use that in my expression, then increment again.


Solution

  • Short answer: i++ is not an "lvalue", so can't be the subject of an assignment.