home *** CD-ROM | disk | FTP | other *** search
- program SimpMem;
-
- { Program copyright (c) 1995 by Charles Calvert }
- { Project Name: SIMPMEM }
-
- { A very simple program showing how to allocate
- and deallocate memory for a pointer to a string. }
-
-
- {$IfDef WINDOWS}
- uses
- WinCrt;
- {$EndIf}
-
- type
- PString = ^String;
-
- var
- MyString: PString;
-
- begin
- New(MyString); { Allocate 256 bytes for the string }
- MyString^ := 'Hello'; { Assign a value to string }
- WriteLn(MyString^); { Write the value to the screen }
- Dispose(MyString); { Deallocate the memory }
- end.
-