*/
Looking for work? Check out our jobs area.
*/

View \POINTERS.PAS

This is the second disk of the PASCAL TUTOR system. It has the

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


(* 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.

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.