uses crt;
var
p: Pointer;
q: ^byte;
r: array[0..19] of byte;
i: Byte;
begin
getmem(p,20);
q:=p;
for i:=0 to 19 do
begin
r[i]:=19-i;
q^:=19-i;
inc(q);
end;
q:=p;
for i:=0 to 19 do
begin
write('r[',i,'] = ',r[i], ' : ');
write('p^ ke-',i,' = ',q^);
writeln;
inc(q);
end;
readln;
end.
nyobain yang laen berikut:
uses crt;
var
p: Pointer;
q: ^byte;
r: array[0..19] of byte;
i: Byte;
begin
getmem(p,20);
q:=p;
for i:=0 to 19 do
begin
r[i]:=19-i;
q^:=19-i;
inc(q);
end;
q:=p;
for i:=0 to 19 do
begin
write('r[',i,'] = ',r[i], ' : ');
write('p^ ke-',i,' = ',q^);
writeln;
inc(q);
end;
readln;
end.
No comments:
Post a Comment