procedure strtoarr(s:string;var a: array of char);
var p:pchar;
I,leng:integer;
begin
p:=pchar(s);
leng:=length(s);
for I := 0 to (leng-1) do
begin
a[i]:=p^;
inc(p);
end;
end;
procedure Test;
var
a: array [0..1023] of char;
s: string;
begin
CopyMemory(@a,PChar(s),Length(s)+1); // plus 1 because the null-terminal
ShowMessage(a);
end;