Can anyone tell me about the result generation of (a++ * ++a)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone tell me about the result generation of (a++ * ++a)?

I know ( ++a * a++) working but not know the working of it (a++ * ++a) and its rslt. I try hard to understand this but can't.

12th Feb 2019, 6:30 AM
Hamza Ali
Hamza Ali - avatar
2 Answers
+ 5
If I recall correctly, that will produce undefined result, because you don't know which ++ will compiler execute first... Just avoid it, it's confusing and not cross compiler friendly
12th Feb 2019, 6:36 AM
Elva
Elva - avatar
+ 4
Just forget about using x, x++ and/or ++x in ANY combination within the same expression and everything will be fine.
12th Feb 2019, 8:06 AM
Anna
Anna - avatar