[comp.lang.c] String lengths

davidsen@steinmetz.ge.com (William E. Davidsen Jr) (02/13/89)

In article <532@rpi.edu> jefu@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@ge-crd.arpa)
  {uunet | philabs}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me