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: string
l: integer;
p: PChar;
c: char;

s := '123';
l := length(s);
p := pchar(s);
inc (p,l);
c := p^;


- Michael
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to