strings

Karl Heuer karl at haddock.ima.isc.com
Sun May 21 08:17:24 AEST 1989


In article <31787 at sri-unix.SRI.COM> diamond at diamond.csl.sony.junet (Norman Diamond) writes:
>[in two separate articles, Doug Gwyn writes:]
>>If you want counted strings, C makes it relatively easy to provide them for
>>yourself...  Furthermore there is no reason your counted-string
>>implementation should be other than perfectly portable.
>
>Yes, just like [you can use Silly Macros to make C look like Algol]
>and still be perfectly portable.  Everyone will hate you.

Not analogous.  Yes, I would curse your grave if you used the SHELLGOL macros
in a program I had to maintain, but no, I would not object to the use of a
struct {size_t; char *} to represent text in cases where the usual model is
inappropriate.

(Note that last phrase: "in cases where the usual model is inappropriate".
For most purposes, \0-termination works just fine.)

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list