I have a function that takes in a pointer to a series of char. I wish to copy 256 chars from that point, and place them in a string.
msg is not null-terminated.
The below code seems to give me some problem. Is there a correct way to do this?
Init( msg: PCHAR)
var
myStr: String;
begin
for i:= 1 to 256 do
begin
myStr[i] := msg[i-1];
end;
end;