[fpc-devel] Zero terminated strings
mschnell at lumino.de
Tue Nov 11 11:07:50 CET 2008
> Are strings not zero terminated?
They are not: a #0 is perfectly allowable character in a (long) string.
That is why you can use strings for storing any kind of byte stream.
But they are: a #0 is automatically added at s[length(s)+1];
But accessing the terminating via string functions is erroneous.
But you can access it with
s := '123';
l := length(s);
p := pchar(s);
c := p^;
More information about the fpc-devel