E
everhappy
Unregistered / Unconfirmed
GUEST, unregistred user!
我用TMemoryStream,但是总是抱错!
也不知道什么问题,大家帮忙看一下代码吧
procedure TForm1.Button1Click(Sender: TObject);
var
MemoryStream:TMemoryStream;
PChrChar;
chrarray:array[0..4] of char;
str:string;
i:integer;
begin
MemoryStream.Create;
// str:='12';
// Pchr:=@str[1];
for i:=0 to 4 do
ChrArray:=char(i);
Pchr:=@ChrArray[0];
MemoryStream.WriteBuf(Pointer(Pchr),4);
MemoryStream.SaveToFile('d:/test.txt');
MemoryStream.Free;
end;
也不知道什么问题,大家帮忙看一下代码吧
procedure TForm1.Button1Click(Sender: TObject);
var
MemoryStream:TMemoryStream;
PChrChar;
chrarray:array[0..4] of char;
str:string;
i:integer;
begin
MemoryStream.Create;
// str:='12';
// Pchr:=@str[1];
for i:=0 to 4 do
ChrArray:=char(i);
Pchr:=@ChrArray[0];
MemoryStream.WriteBuf(Pointer(Pchr),4);
MemoryStream.SaveToFile('d:/test.txt');
MemoryStream.Free;
end;