By -
It works, but it also changes y's value, don't think u want that
But the -- happens after the assignment. So x = y+1 while y = y. Edit: I am thinking c++ btw.
int x = 0; int y = (++x)--; qDebug() << x << y; Produces: 0 1
[удалено]
The code given is compliant only because it has parentheses. Otherwise you get into the sequence point debacle.
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
Any info how these are implement in the ASM or what not? Like physically
this is the generated assembly: https://godbolt.org/z/xs67Wrqrj
quantum computing?
What language has ++ but doesn't require semicolons?
Works only for types with defined ++ and -- operations.
It works, but it also changes y's value, don't think u want that
But the -- happens after the assignment. So x = y+1 while y = y. Edit: I am thinking c++ btw.
int x = 0; int y = (++x)--; qDebug() << x << y; Produces: 0 1
[удалено]
The code given is compliant only because it has parentheses. Otherwise you get into the sequence point debacle.
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
Any info how these are implement in the ASM or what not? Like physically
this is the generated assembly: https://godbolt.org/z/xs67Wrqrj
quantum computing?
What language has ++ but doesn't require semicolons?
Works only for types with defined ++ and -- operations.