There's a difference between C and C++ here; I assumed C was being used by the OP and quoted the C Standard text. In C none of the expressions compile because none of the (pre and post) increment operators result in an lvalue.
C++ however treats both operators differently: the preincrement ++ operator seems to leave an lvalue; the postincrement ++ operator doesn't. While I agree that my assumption could've been totally wrong (about the language being used), the OP should've said which one actually was used.
kind regards,
Jos
C++ however treats both operators differently: the preincrement ++ operator seems to leave an lvalue; the postincrement ++ operator doesn't. While I agree that my assumption could've been totally wrong (about the language being used), the OP should've said which one actually was used.
kind regards,
Jos
Comment