![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
Re: Pre vs Post Incrementing variablesby cdarke (Prior) |
on Sep 12, 2010 at 11:14 UTC ( [id://859830]=note: print w/replies, xml ) | Need Help?? |
a similar test program in a C++ IDE netted the exact same result. In my experience, C and C++ compilers differ. Take the code: A similar line in Perl (allowing for syntax differences) gives 3 3 3, because of optimisation. PHP give 1 2 3, and probably denotes a lack of same. MS Visual Studio 6 C++ you get 3 3 3 when compliled in Release (again, optimisation) but (wait for it) 3 2 1 in Debug (no optimisation). gcc (Windows and Linux) gives 1 2 3 regardless of the optimisation level. Upshot of that? Don't do it!
In Section
Seekers of Perl Wisdom
|
|