rulururu

post Confused about NULL

September 19th, 2008

Filed under: C++ — Kai @ 2:34 pm

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.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

ruldrurd
Powered by WordPress, Content and Design by Kai Bellmann
Entries (RSS) and Comments (RSS)