V
vvyang
Unregistered / Unconfirmed
GUEST, unregistred user!
各位达人帮帮忙,关于 Initialize 和 Finalize 的问题...
type
TVector = record
id: Integer;
text: string;
elems: array of Integer;
end;
PVector = ^TVector;
var
pv: PVector;
p: Pointer;
begin
GetMem(pv, SizeOf(TVector));
Initialize(pv^);
//问题在这,是写 Initialize(pv^) 还是分别写 Initialize(pv^.text)、Initialize(pv^.elems)?
//Delphi 能判断 TVector 中有那些是动态数组么?
//如果能判断,那我换成下面的写法 Delphi 还能判断么?
//p := pv;
//Initialize(p^);
end;
区区 150 分不成敬意...
type
TVector = record
id: Integer;
text: string;
elems: array of Integer;
end;
PVector = ^TVector;
var
pv: PVector;
p: Pointer;
begin
GetMem(pv, SizeOf(TVector));
Initialize(pv^);
//问题在这,是写 Initialize(pv^) 还是分别写 Initialize(pv^.text)、Initialize(pv^.elems)?
//Delphi 能判断 TVector 中有那些是动态数组么?
//如果能判断,那我换成下面的写法 Delphi 还能判断么?
//p := pv;
//Initialize(p^);
end;
区区 150 分不成敬意...