T
Tim Conner
Hi,
I am an ex-delphi programmer, and I having a real hard time with the
following simple code (example ):
Which is the equivalent to the following code ?
var
chars : PChar;
sBack, s : String;
begin
s := Tim Conner XXXXXXXXX';
chars := AllocMem(20);
Move( s[1], chars^, 20); <<-- This
sBack := chars; <<-- and this
ShowMessage(sBack);
FreeMem(chars, 20);
I could write a "move" function to put each character of the string into the
char*, eventhough I would prefer the more appropiate approach.
But what really worries me, is how to take the content of the PChar ( C# =
char* ) and put it back in to the string ??
Thanks in advance,
I am an ex-delphi programmer, and I having a real hard time with the
following simple code (example ):
Which is the equivalent to the following code ?
var
chars : PChar;
sBack, s : String;
begin
s := Tim Conner XXXXXXXXX';
chars := AllocMem(20);
Move( s[1], chars^, 20); <<-- This
sBack := chars; <<-- and this
ShowMessage(sBack);
FreeMem(chars, 20);
I could write a "move" function to put each character of the string into the
char*, eventhough I would prefer the more appropiate approach.
But what really worries me, is how to take the content of the PChar ( C# =
char* ) and put it back in to the string ??
Thanks in advance,