Perhaps you're confusing me with Howard Bullock.

Your example illustrates what I was saying.

When you place the '\0' in the fourth character position you are terminating the string there. No string functions will read past it - whatever is past the third character is unavailable.

If you want to access the rest of the data beyond character 4 you will need to do it a different way, string semantics won't do it for you.

Replacing the '\0' with another character means that it will read up to the next '\0', which will be at the end of your original string, unless something else has used the memory beyond the '\0' in which case you will get garbage.

In your example, the final string would be
"my 1ellow"

[ 12 June 2002, 11:38: Message edited by: Richard Howarth ]