Julie said:
NULL is perfectly acceptable, and is standard.
"The C++ Programming Language" 3rd Edition or Special Edition by Bjarne
Stroustrup (the creator of C++), page 88:
5.1.1 Zero [ptr.zero]
Zero (0) is an int. Because of standard conversions (§C.6.2.3), 0 can be
used as a constant of any
integral (§4.1.1), floatingpoint, pointer, or pointer to member type. The
type of zero will be determined
by context. Zero will typically (but not necessarily) be represented by the
bit pattern allzeros
of the appropriate size.
No object is allocated with the address 0. Consequently, 0 acts as a pointer
literal, indicating
that a pointer doesn't refer to an object.
In C, it has been popular to define a macro NULL to represent the zero
pointer. Because of
C++'s tighter type checking, the use of plain 0, rather than any suggested
NULL macro, leads to
fewer problems. If you feel you must define NULL, use
const int NULL = 0;
The const qualifier (§5.4) prevents accidental redefinition of NULL and
ensures that NULL can be
used where a constant is required.
By the way it is an excellent book, i have been reading it on my own. I
strongly suggest it.
Ioannis Vranos