uses crt;
type pointer=^string;
var
a,b, c, d : pointer;
nilai : String;
begin
clrscr;
nilai := 'ini adalah string nilai';
a := @nilai;
New(b);
New(d);
b^ := 'ini isi pointer b';
c := b; {c menunjuk ke yang ditunjuk b}
d^ := b^;
writeln('alamat pointer a = ', seg(a^):4,'
: ', ofs(a^):4, ' isi pointer a = ', a^);
writeln('alamat pointer b = ', seg(b^):4,'
: ', ofs(b^):4, ' isi pointer b = ', b^);
writeln('alamat pointer c = ', seg(c^):4,'
: ', ofs(c^):4, ' isi pointer c = ', c^);
writeln('alamat pointer d = ', seg(d^):4,'
: ', ofs(d^):4, ' isi pointer d = ', d^);
readln;
end.
Tidak ada komentar:
Posting Komentar