The C programming language

From: John Foust <jfoust_at_threedee.com>
Date: Mon Mar 13 08:46:02 2000

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
Received on Mon Mar 13 2000 - 08:46:02 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:33:05 BST