Answer the question
In order to leave comments, you need to log in
Wrong calculation?
I can't understand why the constructions produce different results, depending on the compiler. Checked on JS and Java, give the same correct result (as I think):
JS:
Java:
Link to Java example: goo.gl/HD223t
And here are the results of C ++:
MSVCC 2015
cpp.sh (gcc 4.9.2)
WTF?
Answer the question
In order to leave comments, you need to log in
For C++, this construct violates the language standard and leads to undefined behavior. You can't write like that in C++.
give the same correct result.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question