|
-
March 30th, 2010, 01:58 AM
#9
Re: forcing value to bool 'true' or 'false' (performance warning)
 Originally Posted by ranjithan
you can make use of the operator ! which will return bool. See the code snippet below.
Here is the point I'm making:
There is no such thing as "BOOL" in C++ -- that is a Windows invention, and it isn't portable (note this is a non-Visual C++ forum). A "bool" is C++ and can be used anywhere a compliant C++ compiler exists, whether it's Windows, UNIX, Mac, or any other operating system.
That's why if you're writing C++ code, and not using the Windows API, you use "bool". Just because a popular OS API uses "BOOL" doesn't make it good to use in any C++ program (and you definitely can't use it if you're on Linux).
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|