CnPack Forum

#1 关于DELPHI 栈中内存保护
今天突然有兴致, 写了一个例子
代码很简单, 如下:
procedure TForm1.btn1Click(Sender: TObject);
var
S, S1, v: String;
begin
S := '1234546788';
S1 := S;
V := '778899';
Move(Pointer(V)^, Pointer(S1)^, 8);
// PString(S)^ := '11111111111111111111111111111111111111111111';
// FillMemory(PChar(S), 10, 0);
// CopyMemory(PChar(S), PChar(V), 10);
mmo1.Lines.Add('S:'+IntToStr(Integer(@S))+' S1:'+IntToStr(Integer(@S1)));
Caption := S;
end;
运行到M ..

#1 >>Next Page

Forum:CnPack IDE 专家包（CnW ...
Thread:关于DELPHI 栈中内存 ...
Next Thread:还是cb下面的代码提示 ...

Home
Login

Powered by Discuz!