Thread: Combat Fixes
View Single Post
  #15  
Old 09-18-2008, 07:52 PM
James76
Sarnak
 
Join Date: Sep 2008
Location: Canada
Posts: 53
Default

Quote:
Originally Posted by bleh9 View Post
Maybe I'm missing something, but myarray[x++] isn't the same as myarray[++x]. Also, ++x and x++ often compile to the same thing.
I said that you don't need x++ UNLESS you're using it on a line such as "myarray[...]" where it actually matters, where more than one segment is processed before the rest of the statement. I even defined what post-increment and pre-increment means. Why am I defending myself?

And assuming it will compile to the same thing is incorrect, it will only do so if the specific optimization flag is set on the gcc execution. Assuming anything is poor code, its always better to implement as intended.
__________________
Expert developer, I do it for a living.
Don't let the "Junior" tag fool you.
Reply With Quote