dengan Pascal
Berikut source code program :
Program Pointer_tidak_bertipe; Uses crt; Var p : Pointer; q : ^Byte; r : array [0..100] of Byte; i,n : Byte; Begin Clrscr; GetMem(p, 20); q := p; Write('Input angka : '); readln(n); Clrscr; For i := 0 to n do Begin r[i] := n - i; q^ := n - i; inc(q); End; q := p; For i := 0 to n do Begin Write('r[ ', i ,' ] = ', r[i], ': '); Writeln('p^ ke-', i ,' = ', q^); inc(q); End; Readln; End.
Dan berikut output program diatas :
1. Tampilan saat program dijalankan
3. Tampilan akhir program