C's NULL sucks, because it's not a unique value and thus can be "lost" or confused with other values.
Having a distinct null which can only be arrived at by typing the characters "null" is a good thing, imo.
Having a distinct null which can only be arrived at by typing the characters "null" is a good thing, imo.
This was in 1999, I think.
#define NULL __DARWIN_NULL
...
#define __DARWIN_NULL ((void *)0)
int *ptr = NULL; #ifdef __cplusplus
#define __DARWIN_NULL __null
#else /* ! __cplusplus */
#define __DARWIN_NULL ((void *)0)
#endif /* __cplusplus */
So the code you mentioned works just fine in C++.