bug-gnulib
[Top][All Lists]
Advanced

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

Re: 0 vs. NULL (was: Test for getaddrinfo() broken on Tru64 UNIX 5.1)


From: Bruno Haible
Subject: Re: 0 vs. NULL (was: Test for getaddrinfo() broken on Tru64 UNIX 5.1)
Date: Sat, 13 Oct 2007 22:45:18 +0200
User-agent: KMail/1.5.4

Benoit SIGOURE wrote:
> In C++, `0' is the preferred way of expressing `NULL'.

In C++, 0 can be used instead of NULL everywhere except inside sizeof and
varargs argument lists.

But what is _preferred_, depends on your and your co-developers' habits.

People who also program in C prefer NULL because NULL does not have the
pitfalls with argument passing (that Simon mentioned) and in sizeof.

People who also program in Java or C# prefer NULL because in these languages
there is a strict distinction between pointers and integral values.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]