| Logical Comparisons |
[19 Jan 2007|12:45am] |
I just noticed in another post a comment about comparison statements such as this being confusing:
if( blVariable == true ) It's very bad to do something like that in C, and I didn't think it was much better in C++.
My reasoning is that whilst true and false in C++ might be guaranteed to be correct for the hardware the code is compiled for (TRUE and FALSE are not in C, but it's sort of complicated), it's very easy for boolean comparisons to cause strange errors.
Here is why. ( Read more...Collapse )
|
|