BOOL jon;
jon = 0;
or
if(jon!=0)
basically, is it faster to check the state of a BOOL or to save to it?
BOOL jon;
jon = 0;
or
if(jon!=0)
basically, is it faster to check the state of a BOOL or to save to it?
Saving a bool and making a condtional branch are two different things, you can't use one over the other. Perhaps you are wondering about saving the result of some condition in a bool so you don't have to make the test multiple times?
No. I am asking which line of code runs faster. For my purposes, I need to know which is faster, tho I understand that they do not do the same thing.
Depends on your compiler
Look at the assembler code it generates
I think it's the if statement that takes more time.
It also depends if the if statement is true or not (because of the jump instruction).
Post further replies here
http://www.cprogramming.com/cboard/s...threadid=21897
Duplicate post