G
Gopi Subramanian
g++ should be using 0 as well. Are you sure you are using g++ and not gcc?
Are you sure the compiler knows the code is C++ and not C.
The g++ I use, has the following in the header file that defines NULL:
#undef NULL
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif
I use gcc 2.95.3 and the definition i have in stdef.h is
if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#define NULL ((void *)0)
#endif /* G++ */
#endif /* NULL not defined and <stddef.h> or need NULL. */
#undef __need_NULL