Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : POINT.PAS

 
Output of file : POINT.PAS contained in archive : PASTUT.ZIP
(* Chapter 12 - Program 1 *)
program First_Pointer_Example;

type Int_Point = ^Integer;

var Index : Integer;
Where : ^Integer;
Who : ^Integer;
Pt1, Pt2, Pt3 : Int_Point;

begin
Index := 17;
Where := Addr(Index);
Who := Addr(Index);
Writeln('The values are ',Index:5,Where^:5,Who^:5);

Where^ := 23;
Writeln('The values are ',Index:5,Where^:5,Who^:5);

Pt1 := Addr(Index);
Pt2 := Pt1;
Pt3 := Pt2;
Pt2^ := 151;
Writeln('The Pt values are',Pt1^:5,Pt2^:5,Pt3^:5);
end.




{ Result of execution

The values are 17 17 17
The values are 23 23 23
The Pt values are 151 151 151

}


  3 Responses to “Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : POINT.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/