Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!ukc!warwick!cuuee From: cuuee@warwick.ac.uk (Sean Legassick) Newsgroups: comp.lang.c Subject: Re: NULL as a string terminator Message-ID: <1990Aug24.153158.12020@warwick.ac.uk> Date: 24 Aug 90 15:31:58 GMT References: <24141@megaron.cs.arizona.edu> <134@blekko.UUCP> <1990Aug20.000227.12867@icc.com> Sender: news@warwick.ac.uk (Network news) Organization: Computing Services, University of Warwick, UK Lines: 32 In article <1990Aug20.000227.12867@icc.com> cbp@icc.com (Chris Preston) writes: [quoting a quote] >>*You* like your non-standard name for '\0', but no one else will >>know what it means, and it's unlikely that it will ever be a Big Win >>for you (like if we start terminating strings with ^A or something). > > Then, it will be a very big win. Using two characters would break > much more software than would changing the terminator to a single > different letter. In the case of doing a sprinkling of assembly > on DOS or CPM, the $ is used as a terminator (typically) when calling an > interrupt service routine. If you are doing assembly calls in a section > of code you need only > [code omitted] > > Typically, one could even replace '$' and '\0' further with > DOS_CPM_TERMINATOR and UNIX_DOS_C_CALL_TERMINATOR. So, while you as > a Unix or Dos or whatever programmer might not care about the others, it > allows a level of abstraction that facilitates portability and > maintainability. > > > Mind you, I might like shorter labels, but one get's the idea. > Very clever, but it hardly solves the problem of different string representations - consider Pascal. It has not terminator, strings start with a count. No amount of #defining will solve that. --------------------------------------------------------------------------- Sean Legassick, cuuee@uk.ac.warwick.cu "Man, I'm so hip I find it Computing Services (the walking difficult to see over University of Warwick C obfuscator!) my pelvis" - D Adams