BOOL vs. bool
-
which one is "better"? i know bool is more standardized but BOOL is more efficient, but which one is more commonly used, furthermore, which one should i use? >>Roman<<
-
which one is "better"? i know bool is more standardized but BOOL is more efficient, but which one is more commonly used, furthermore, which one should i use? >>Roman<<
-
which one is "better"? i know bool is more standardized but BOOL is more efficient, but which one is more commonly used, furthermore, which one should i use? >>Roman<<
BOOL edges out bool in performance just by a very tiny amount. Here are the rules I use. If I am doing WIN32 code, I use BOOL. Otherwise, for the other 90% of my code, I use bool. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
You answered your question. I think that is better to use the more efficient... Do you prefer to use
while(true)
orfor(;;)
?:-D Regards!!! Carlos Antollini. Sonork ID 100.10529 cantolliniwhile(true) and for(...) take the same amount of time. I have yet to see a compiler not optimize while (true) away. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
BOOL edges out bool in performance just by a very tiny amount. Here are the rules I use. If I am doing WIN32 code, I use BOOL. Otherwise, for the other 90% of my code, I use bool. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
thanks, so for libraries i make, ill use bool if they're not windows-specific ;D >>Roman<<
-
which one is "better"? i know bool is more standardized but BOOL is more efficient, but which one is more commonly used, furthermore, which one should i use? >>Roman<<
You answered your question. I think that is better to use the more efficient... Do you prefer to use
while(true)
orfor(;;)
?:-D Regards!!! Carlos Antollini. Sonork ID 100.10529 cantollini -
which one is "better"? i know bool is more standardized but BOOL is more efficient, but which one is more commonly used, furthermore, which one should i use? >>Roman<<
Hi! Try this: bool test_a = 3; BOOL test_b = 3; or that one: bool test_a = true; switch(test_b) { case 4: break; case 5: break; } and the same for BOOL. You will see the difference :) Moreover: sizeof(BOOL) != sizeof(bool) ===> 4 != 1 I use always bool's, but when I deal with Win32 - I use BOOL's. Mukkie