String lengths

William E. Davidsen Jr davidsen at steinmetz.ge.com
Tue Feb 14 00:51:17 AEST 1989


In article <532 at rpi.edu> jefu at pawl.rpi.edu (Jeffrey Putnam) writes:

| I like the C model for strings.  I like it mostly for its simplicity
| and ease of use.  It may well be that a representation for strings
| that includes string length as a part of a structure is better for
| efficiency, or more modular or whatever.  But! the model used is
| simple and introduces no magic into the language.
| 
| Magic?  Yup.  Magic is what happens when the language (or operating system
| or hardware) does something odd that is not reachable by the user.  This
| includes magic strings, magic arrays (arrays stored in the same way - that
| is with extra information hidden from the user), magic library calls (like
| some VMS calls) and so on.  

  Getting things into implementation dependent structures (or typedefs)
is hardly a new idea. No portable program ever cares what's in a FILE
for instance, since there are a lot of non-UNIX implementations around.

-- 
	bill davidsen		(wedu at ge-crd.arpa)
  {uunet | philabs}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list