At 07:39 PM 3/11/00 +0001, Hans Franke wrote:
Lets take
(the often used - but realy simple) example of string handling.
Let's assume you want to move a 10 byte string. C strings are
by definition byte orientated and terminated by a byte containing
the NIL code (x'00').
Well, that's the way the string.h functions define strings
of text characters. You can define your own string functions
quite easily of course, and nothing forces you to use string.h.
In fact, for any project of moderate size especially if you
desire portability, I'd recommend at least wrappering the
string.h functions as well as any other standard C libraries.
In other words, don't use strcmp(), use your own myStrCmp()
or whatever. Then you're free to replace the underlying
code function.
I'd barely call C strings "strings". They're buffers of chars.
To me, a string will always be more BASIC-like, where strings
are managed by the functions that operate on them, allowing you
to concatenate them without regard to buffer overflow.
- John