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

 
Output of file : POINTERS.PAS contained in archive : PASTUT.ZIP
(* Chapter 12 - Program 3 *)
program Pointer_Use_Example;

type Name = string[20];

var My_Name : ^Name; (* My_Name is a pointer to a string[20] *)
My_Age : ^integer; (* My_Age is a pointer to an integer *)

begin
New(My_Name);
New(My_Age);

My_Name^ := 'John Q Doe';
My_Age^ := 27;

Writeln('My name is ',My_Name^);
Writeln('My age is ',My_Age^:3);

Dispose(My_Name);
Dispose(My_Age);
end.




{ Result of execution

My name is John Q Doe
My age is 27

}


  3 Responses to “Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : POINTERS.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/