0
What does the warning mean here?
https://code.sololearn.com/cRV3VegtaX6h/?ref=app What does operation on x is undefined mean?
4 Réponses
+ 3
Always avoid your code with such types of calculation it may cause UB some compiler will give you warnings and its Compiler dependent . And always use different different variables so it will calculate more accurate . if you will try these calculations on java it may give you errors.
+ 3
The compiler is confused just like I am.
The compiler is confused whether to perform addition or increment or both. So it assumed it to be undefined in simple words. (schrodinger effect) ;)
Who would write such a confusing code anyway?
+ 1
rkk Oh no I didn't mean to confuse anyone haha. I just wanted to try assignment operation and increment operation on the same code.
Didn't realize that not using a different variable would produce such a warning. Thanks for helping me tho ;)
0
A.S. got it, will try to avoid this in future codes.