TITLE: Just when you thought it was safe to use NULL PROBLEM: Many implementations use a #define for NULL in system header files which could cause problems in your code. RESPONSE: Jim Adcock (jimad@microsoft.com) Given all these hassles, some old time C++ hackers just try avoiding use of NULL. Just use '0' everywhere instead. Make sure that that '0' is explicitly cast to the "right" type when used as a vararg -- just as vararg need *always* be explicitly be cast to exact type in vararg situations. ....Of course, use of NULL will probably be mandated by your local C++ coding convention facists, in which case you'll get to discover all these various failure modes for yourself! RESPONSE: MfG Kai (???) Or maybe, instead of NULL, use a NIL macro. I've seen several forms, two are #define NIL(type) ((type)0) or #define NIL(type) ((type *)0) Of course, too bad if you are not consistent with this. This "silently guarantees" that you always cast 0 to the correct type. You might consider persuading them to mandate one (but NOT both, for heaven's sake!) of the above macros ... helps documentation as well! RESPONSE: Marshall Cline (cline@sun.soe.clarkson.edu) The most portable way to compare against the nil ptr is to compare against `0'. Some programmers use a #define to set NULL to `0', but that can conflict with the way the standard libraries #define NULL. There is no portable way to define a `const' ptr called `NULL' that can be compared against any arbitrary ptr -- the literal `0' is acceptable for this however.