This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: No NULL in 3.0.2???


>>>>> "JDonner" == JDonner  <jdonner0@earthlink.net> writes:

    JDonner> Hi, This:

    JDonner> int main(int argc, char** argv) { int* p = NULL; }

    JDonner> produces this:

    JDonner> null.cpp: In function `int main(int, char**)':
    JDonner> null.cpp:3: `NULL' undeclared (first use this function)
    JDonner> null.cpp:3: (Each undeclared identifier is reported only
    JDonner> once for each function it appears in.)

    JDonner> Isn't NULL still part of the standard?  I can't believe
    JDonner> it'd be deprecated.  I'm sure there are still a lot of
    JDonner> people who use NULL.

    JDonner> If NULL _is_ slated for eventual removal, I think it's
    JDonner> still very much alive right now.

NULL never was in the C++ standard - it is a C invention and in fact,
Bjarne Stroustrup (the "inventor" of C++) strongly discourages its use
in his book "The C++ Programming Language". If programming in C++ you
should really prefer '0' over the preprocessor variable 'NULL'.


Claudio


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]