Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!tektronix!percival!bucket!servio!penneyj From: penneyj@servio.UUCP (D. Jason Penney) Newsgroups: comp.lang.c Subject: Re: Null revisited (briefly) Keywords: NULL Message-ID: <102@servio.UUCP> Date: 14 Feb 89 23:40:44 GMT References: <13068@steinmetz.ge.com> Reply-To: penneyj@servio.UUCP (D. Jason Penney) Organization: Servio Logic Development Corp.; Beaverton, OR Lines: 19 I strongly disagree with Bill Davidsen's suggestion for null-terminating C strings. I submit the following example as safer, cleaner, and more legible: char aString[20]; aString[0] = '\0'; 'x' is a literal of type char. Thus, '\0' is the char with value 0, which is really what was intended here. When you assign an int or a pointer to a character, the reader ends up wondering if the type mismatch is unintentional. -- D. Jason Penney Ph: (503) 629-8383 Servio Logic Corporation uucp: ...ogccse!servio!penneyj 15220 NW Greenbrier Parkway #100 Beaverton, OR 97006