Newsgroups: comp.lang.c
Path: utzoo!telly!druid!darcy
From: darcy@druid.uucp (D'Arcy J.M. Cain)
Subject: Re: NULL as a string terminator
Message-ID: <1990Aug10.140314.12219@druid.uucp>
Organization: D'Arcy Cain Consulting, West Hill, Ontario
References: <1990Aug7.210152.7586@arcturus.uucp>
Date: Fri, 10 Aug 90 14:03:14 GMT

In article <1990Aug7.210152.7586@arcturus.uucp> evil@arcturus.uucp (Wade Guthrie) writes:
>and Doug Gwyn says:
>> You're correct; the example code would happen to work with the traditional
>> definition of NULL as plain 0, but not if it's defined as ((void*)0).
>That is why I have made it a practice to define a macro:
>#define	NULLchar	'\0'
>
Can someone explain to me what is wrong with using '\0' or even 0 when a
zero byte is required.  Is there ever a possibility that NULLchar or
whatever will evaluate to anything but a zero byte.  Perhaps this is for
people who get paid by the line of code.

Let's see.  If I was paid by the line of code ...

#define IF if
#define ELSE else
#define LOOP_WHILE_STATEMENT_TRUE(x) while(x)
#define DO_IF_STATEMENT_TRUE(x) IF(x)
etc

I bet I could turn "Hello, world" into a major GNU project. :-)

-- 
D'Arcy J.M. Cain (darcy@druid)     |
D'Arcy Cain Consulting             |   MS-DOS:  The Andrew Dice Clay
West Hill, Ontario, Canada         |   of operating systems.
+ 416 281 6094                     |
