[fpc-pascal] PChar resize

Anton Shepelev anton.txt at gmail.com
Wed May 11 17:44:18 CEST 2011


In addition to what Mattias has said,
the following works pretty well:

Program StrTest;
Var a:Pchar;
Begin
a:=PChar(nil);
Reallocmem(a,20);  //ko
a[0] := 'A';
a[1] := 'n';
a[2] := 't';
a[3] := Chr(0);
WriteLn('Done: ', a);
End.

Anton



More information about the fpc-pascal mailing list