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 erro
ABorka schreef:
Hi,
Are strings not zero terminated? I have a function declared:
function myfunc(s :String; i: Integer):String;
When going through the string "s" with asm instructions, it does not
seem to have a zero byte at the end. Is this normal or something is not
OK (maybe now with utf8
strings are always null-terminated, for delphi compatibility.
zero char is located at s[length(s)+1], but should never accessed directly.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel