主题:????帮帮我,搞不懂??指针问题 +分
type pn=^num;
num=record
numstring:string;
next:pn;
end;
var u,head:pn;
procedure readnums;
var v,p:pn;
k,n:integer;
number:string;
begin
readln(n);
u:=head;
for k:=1 to n do
begin
read(number);
new(p);
p^.numstring:=number;
p^.next:=nil;
v^.next:=p;
v:=p;
end;
end;
begin
readnums;
u:=head;
while u^.next<>nil do
begin
writeln(u^.next^.numstring);
u:=u^.next;
end;
end.为什么只能读进一个数???编译通过却在运行过程有错误
num=record
numstring:string;
next:pn;
end;
var u,head:pn;
procedure readnums;
var v,p:pn;
k,n:integer;
number:string;
begin
readln(n);
u:=head;
for k:=1 to n do
begin
read(number);
new(p);
p^.numstring:=number;
p^.next:=nil;
v^.next:=p;
v:=p;
end;
end;
begin
readnums;
u:=head;
while u^.next<>nil do
begin
writeln(u^.next^.numstring);
u:=u^.next;
end;
end.为什么只能读进一个数???编译通过却在运行过程有错误