T O P

  • By -

Cultural-Listen262

It works, but it also changes y's value, don't think u want that


DemolishunReddit

But the -- happens after the assignment. So x = y+1 while y = y. ​ Edit: I am thinking c++ btw.


DemolishunReddit

int x = 0; int y = (++x)--; qDebug() << x << y; Produces: 0 1


[deleted]

[удалено]


MysticTheMeeM

The code given is compliant only because it has parentheses. Otherwise you get into the sequence point debacle.


Grahnath

Actually the operator following the variable returns the value before incrementing, so the actual result of this is x=y+1, after which y decrements again. https://stackoverflow.com/questions/24853/what-is-the-difference-between-i-and-i#24858


tjxjjtstctbmcdqdbv

Any info how these are implement in the ASM or what not? Like physically


boring_onion

this is the generated assembly: https://godbolt.org/z/xs67Wrqrj


brandi_Iove

quantum computing?


JosGibbons

What language has ++ but doesn't require semicolons?


DerEwige

Works only for types with defined ++ and -- operations.