cout<<(x++)++; //fails
cout<<++(++x); //passes
Why does the post increment fail ? I see it happen but not sure of the technical reason.
x++
returns an rvalue so you can't perform ++
again on it. On the other hand, ++x
returns an lvalue so you can perform ++
on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With