Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: NULL versus 0 Date: Sun, 26 Sep 2021 02:17:15 -0700 Organization: None to speak of Lines: 21 Message-ID: <875yunlmqs.fsf@nosuchdomain.example.com> References: <21138a34-469b-4c7a-9ef1-e9307ba52673n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="7277c1997095cddeb279520f2fb83c36"; logging-data="28037"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/g9z99O5wUFnjTip/o+HR4" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:wsPsYccTZS5nFQpE8PZ6tzDqPN8= sha1:UmsBnOSIyZydPhpaNfmxEp4mNno= Xref: csiph.com comp.lang.c++:81599 Jorgen Grahn writes: > On Sat, 2021-09-25, see.my....@gmail.com wrote: >>> int *pInt = 0; >>> >>> Nothing inherently wrong with that, but in C, it would be more >>> traditional to use NULL. >> >> It would be more traditional in C++, as well. > > Opinions varied. Before nullptr, I always used NULL in C and 0 in > C++. IIRC using 0 was a common recommendation here, too, for whatever > reason. As I recall, Stroustrup's books used 0 when a null pointer constant was required, and that was probably the origin of the (pre-nullptr) convention to use 0 in C++ while NULL is more widely recommended in C. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */