那么如果
presponsebufferbyte;
presponsebuffer指向一个byte数组,responselenth是数组长度
我写以下代码
i:integer;
str;string;
for i := 0 to (responselenth-1)do
begin
str := Format('%x',[presponsebuffer^]);
inc(presponsebuffer);
memo1.Lines.Add(str);
end;
错误提示:
access violation at address 6045843e in module 'project1.exe'.read of address 00000000
const
responselenth = 10;
var
presponsebufferbyte;
I : Integer;
begin
presponsebuffer := PByte(PChar('0123456789'));
for I := 0 to responselenth - 1do
begin
memo1.Lines.Add(format('%d',[presponsebuffer^]));
Inc(presponsebuffer);
end;
end;