Which one is faster?

Pages: 123
xorebxebx, no, it is not a good or bad compiler and/or optimization options.
Iar compiler produces the same output with full optimization.
The fact is that if you wrote worst code no optimizers could rescue it.

And "which one is faster" if you write your code for avr with gcc toolchain? ;-)
boolivar: I don't know. Are you sure the second one is faster just because it's shorter?. In my experience, comparing pointers takes much longer than comparing integers.
helios, may be you can explain to me what is the difference between comparing integers and pointers? ;-)
I am just making a wild guess. To compare pointer values which contains memory address in the form of 32 bits or 64 bits take longer compared to integer which could be contained in say 16 bits depending on platform ?

PS Actually I am keen to know the answer also :)
Topic archived. No new replies allowed.
Pages: 123