Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun-barr!texsun!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: strings Message-ID: <4184@ficc.uu.net> Date: 14 May 89 19:05:07 GMT References: <2846@tank.uchicago.edu> <5785@cbnews.ATT.COM> <10087@smoke.BRL.MIL> <456@sdti.SDTI.COM> Organization: Xenix Support Lines: 16 C strings have a major disadvantage that's got nothing to do with performance. You can't just stick arbitrary binary data in a string and expect it to work. If there is a null anywhere in that data it's going to cut you. Strings in variant-record form, with a length and data, or dope vectors, with a length an a pointer, are just plain more versatile than C strings. Luckily, however, 'C' is not tied to its runtime library. It's possible to not only use a completely different kind of string in the language, but to mix the two. It's a pity X3J11 didn't see fit to standardise a 'length' escape like the common "\p" (for 'pascal') on the Mac. Maybe "\l". -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Business: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. Personal: ...!texbell!sugar!peter, peter@sugar.hackercorp.com.