On Thursday 21 April 2005 1:37 pm, synthetoonz@bellsouth.net wrote:
Explicitly stated, if (pointer == NULL) /* The pointer must be NULL */
The joy of ! (that's NOT) is that it helps do the same sort of check with less typing.
So, you could say if the ( !pointer ) and it means the same thing as above. This works in nearly all implementations, and I certainly use it. But, it is technically improper. The "(pointer == NULL)" expression is much more readable, especially to some programmers who might be less strong in C or C++. But, the "( !pointer )" does avoid, as you pointer out the single vs. double "=" issue. (But, I'm being somewhat pedantic today after a late BLU meeting and an early start at work on top of giving blood). -- Jerry Feldman
Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9