From owner-freebsd-bugs Tue Feb 18 04:27:51 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id EAA00846 for bugs-outgoing; Tue, 18 Feb 1997 04:27:51 -0800 (PST) Received: from murkwood.gaffaneys.com (dialup13.gaffaneys.com [134.129.252.32]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA00839 for ; Tue, 18 Feb 1997 04:27:41 -0800 (PST) Received: (from zach@localhost) by murkwood.gaffaneys.com (8.8.5/8.8.5) id GAA14799; Tue, 18 Feb 1997 06:28:03 -0600 (CST) To: John-Mark Gurney Cc: Peter Mutsaers , freebsd-bugs@freefall.freebsd.org Subject: Re: bin/2752: NULL is used instead of 0 many places References: Mime-Version: 1.0 (generated by tm-edit 7.100) Content-Type: text/plain; charset=US-ASCII From: Zach Heilig Date: 18 Feb 1997 06:28:01 -0600 In-Reply-To: John-Mark Gurney's message of Tue, 18 Feb 1997 00:14:59 -0800 (PST) Message-ID: <87bu9ib8oe.fsf@murkwood.gaffaneys.com> Lines: 30 X-Mailer: Gnus v5.3/Emacs 19.34 Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk John-Mark Gurney writes: > yes... but he's talking about this: > char a = '\0'; > this way the compiler KNOWS it's a char... and that it's the nul > char... and doesn't convert the int 0 to char 0... But, it doesn't know that '\0' is a 'char', since it really is an 'int'. The only real reason to use '\0' instead of a plain 0 is stylistic only. ANSI C does not have character constants, though C++ does. Check out this small program: #include int main(void) { printf("sizeof (char) is: %d\n", (int) sizeof (char)); printf("sizeof '\\0' is: %d\n", (int) sizeof '\0'); printf("sizeof (int) is: %d\n", (int) sizeof (int)); return 0; } -- Zach Heilig (zach@blizzard.gaffaneys.com) | ALL unsolicited commercial email Support bacteria -- it's the only | is unwelcome. I avoid dealing form of culture some people have! | with companies that email ads.