我的循环链接怎么不对?
chons 2001-10-18 12:10:37 var
p,current,head,tail:pType;
for i:=1 to 6 do
begin
new(p);
current:=nil;
head:=nil;
tail:=nil;
p^.data:=i;
p^.next:=nil;
if i=1 then head=p
else current^.next:=p;
current:=p;
if i=6 then
begin
tail:=p;
current^.next:=head;
end;
end;
结果在那一步就出现了运行错误,编译是没有错误的。这个方法在VC里是完全正确的。在
Delphi里怎么会错误呢。
哪位知道告诉我啊。
刚学Delphi指针啊。