home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
pascal
/
pascsrc.arc
/
POINTERS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
478b
|
22 lines
(* 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.