C++ definition of NULL
Per Bothner
bothner@cygnus.com
Wed Mar 3 06:51:00 GMT 1999
"Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de> writes:
> a) Replace all occurences of NULL with 0. This is IMHO the Right Thing
> (tm), because the NULL symbol is an ugly hack, and just there for
> backwards compatibility.
You've got it backwards. It is defining integer literal 0 as the
null pointer which is the ugly hack, but we're stuck with it
because of backwards compatibility.
On the other hand, using NULL as the null pointer is sanctioned
by common sense, tradition, helps code readability, and (using
some name or other) is what every other high-level language
providing pointers does.
The C++ committee blew this one.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner
More information about the Gcc
mailing list