In fact, the equivalent C code "i+(i++)" is undefined behaviour in ISO C: the compiler is allowed to return (assuming the variable starts off with 2) any value, or write code to format your computer's disks, or write code to format everybody else's computers' disks, or cause daemons to fly out of your nose.
For related fun, try the various "$i=$i++" (also undefined).
In reply to Re: post-increment/pre-increment blues
by ariels
in thread post-increment/pre-increment blues
by wil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |