Mail Archives: djgpp/1997/02/18/10:49:27
At 05:37 PM 2/17/97 EST, fwec AT juno DOT com (Mark T Logan) wrote:
>
>Thank you for your reply. However, I have one question. If NULL always
>equals 0 in C++, why shouldn't I use NULL?
>
On most compilers you can, since they #define NULL to 0 in C++ mode.
for example:
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void*)0)
#endif
Check the headers of your compiler. Note that when using NULL in C++ your
program is not portable. Best thing is to use 0.
Eyal
- Raw text -