This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with using "pEdge==NULL"
- From: Erik <sigra at home dot se>
- To: jeffreyholle at bellsouth dot net
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 09 Sep 2007 18:35:25 +0200
- Subject: Re: Problem with using "pEdge==NULL"
- References: <fbl2sp$4hn$1@sea.gmane.org>
Jeffrey Holle skrev:
> I'm creating an application that attempted to employ the statement:
> if(m_future.getEdges().second!=NULL)
Since this is C++ you should not use NULL anyway. so the above code
should be
if (m_future.getEdges().second)
(See the book by Bjarne Stroustrup, the creator of C++, "The C++
Programming Language", published in year 2000: quote from page 88:
"In C, it has been popular to define a macro NULL to represent the zero
pointer. Because of C++'s tighter type checking, the use of plain 0,
rather than any suggested NULL macro, leads to fewer problems." At page
433, he calls the NULL macro "infamous".)