Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
It's an increment and decrement operator

What I have tried:

Do we use bodmass in this increment operator
Posted
Updated 28-Jul-22 5:13am

 
Share this answer
 
Comments
k5054 28-Jul-22 9:09am    
Beat me to it by about a minute.
OriginalGriff 28-Jul-22 9:56am    
:DEasier for me to find stuff I wrote, I guess!
Quote:
Y+=y++ +++y/y++++y+y where y = 2

Great mess. This expression can give absolutely any result and all are correct.
Result depend on internals of compilers and can even change depending on which optimization is used.
More than 1 increment or decrement on same variable lead to grey zone where result is just unpredictable.
Never use such expression in real life programs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900