on-internet
← Community

Precedence of increment and decrement operators in C++

Stack Overflow ·

I tried this on my gcc: int a=1; cout<<(--a)--; and the output is 0; but change it to cout<<--(a--); results in an error (lvalue required as decrement operand). Could someone enlighten me about this? Thanks!

Comments

Sign in or sign up to comment and upvote.

No comments yet.