Confused about NULL
September 19th, 2008
NULL in c is defined as (void*)0, While for C++ its simple 0. Any ideas ?
#ifdef __cplusplus #define NULL 0 #else #define NULL ((void *)0) #endif
As you know C++ is a direct descendant of C that retains almost all of C as a subset. Maybe it’s because of the fact that C++ provides stronger type checking than C and directly supports a wider range of programming styles than C.
Obviously it’s not that important because well written C tends to be legal C++ also.





