RE: Problem with using "pEdge==NULL"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Since this is C++ you should not use NULL anyway.

I disagree with Stroustrup on the issue of whether or not to use NULL.  (His concern makes sense from the C days when some C compilers defined NULL to be ((void*)0), which is not desirable in C++, but most header files that define NULL are aware of C++-isms and why ((void*)0) is not desirable for C++.)

And NULL is in the C++ (ISO 14882) standard.

Although my druthers is that Stroustrup should have taken the opportunity to introduced 'null' or 'nil' or something akin as a new keyword proper, instead of as a macro.  Alas, he did not.

GCC defines NULL to __null, which is more typesafe than using 0.

--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux