Path: utzoo!mnetor!uunet!husc6!think!ames!sdcsvax!ucsdhub!jack!sdeggo!dave From: dave@sdeggo.UUCP (David L. Smith) Newsgroups: comp.arch Subject: Re: C machine Message-ID: <164@sdeggo.UUCP> Date: 19 Dec 87 21:56:09 GMT References: <261@ivory.SanDiego.NCR.COM> Organization: Lazy Programmer's Society of San Diego Lines: 20 In article <261@ivory.SanDiego.NCR.COM>, jan@ivory.SanDiego.NCR.COM (Jan Stubbs) writes: > Personally, I can't imagine any convenience a null terminated string would > have over a string preceded by its length. Well, there is no limit imposed on the length of the string. It also takes up one less byte per string in overhead (unless you wanted to limit your string length to 255 characters) which isn't very important today, but probably was when C was first defined. Besides, there's nothing that says you can't write a string package which has the string preceeded by the length. If this were still NULL-terminated, it would still work with exsisting functions (by passing the actual beginning of the string to them). -- David L. Smith {sdcsvax!man,ihnp4!jack!man, hp-sdd!crash, pyramid}!sdeggo!dave man!sdeggo!dave@sdcsvax.ucsd.edu "rm -r / : A power toy is not a tool."