On Thu, 29 Jun 2023 21:18:44 +0700
Hairy Pixels via fpc-pascal <[email protected]> wrote:

> What is really happening in this snippet? I think it must be
> implicitly taking the address of the constant string but is it also
> adding the null terminator automatically? The string prints with
> writeln so it must be null terminated right?
> 
> var
>   p: Pchar;
> begin
>   p := '123';
>   writeln(p);

AFAIK the trailing #0 is already stored in the binary.

Mattias
_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to