M
mao
Unregistered / Unconfirmed
GUEST, unregistred user!
问题是:程序中定义了这么一个记录
Tusrdata= record
num:integer;
inf:array[0..1024] of char
end;
tSocketData=Record
msgCode: word;
msgLen :word;
case integer of
0: (usrdata:Tusrdata);
1: (order:integer);
end;
pSocketdata= ^TSocketdata;
procedure CreateSocket(var sockdataSocketdata);
var
lbuf:array[0..100] of char;
i:integer;
begin
for i;=0 to 99 do
lbuf:='a';
sockdata^.msgcode:=1;
sockdata^.msglen:=104;
sockdata^.usrdata.num:=1;
strplcopy(sockdata^.usrdata.inf,lbuf,100);
//这句话出错,即使是采用for循环赋值也错,报告是 内存访问非法。
end;
Tusrdata= record
num:integer;
inf:array[0..1024] of char
end;
tSocketData=Record
msgCode: word;
msgLen :word;
case integer of
0: (usrdata:Tusrdata);
1: (order:integer);
end;
pSocketdata= ^TSocketdata;
procedure CreateSocket(var sockdataSocketdata);
var
lbuf:array[0..100] of char;
i:integer;
begin
for i;=0 to 99 do
lbuf:='a';
sockdata^.msgcode:=1;
sockdata^.msglen:=104;
sockdata^.usrdata.num:=1;
strplcopy(sockdata^.usrdata.inf,lbuf,100);
//这句话出错,即使是采用for循环赋值也错,报告是 内存访问非法。
end;