Language:
Русский
English
Pointer types
A pointer type variable contains the memory address of a dynamic variable of a specified base type.
You can assign a value to a pointer variable with:
- the New or GetMem procedures
- the @ operator
- the Ptr function
The reserved word nil denotes a pointer constant that does not point to anything.
Pointer
The predefined type Pointer denotes an untyped pointer (a pointer that does not point to any specific type).
PChar
The predefined type PChar denotes a pointer to a null-terminated string.
PChar is declared as:
type PChar = ^Char;
Borland Pascal for Windows supports a set of extended syntax rules (controlled by the $X compiler directive) to facilitate handling of strings using the PChar type.
Example
{ Pointer Type Declaration }
type
BytePtr = ^Byte;
WordPtr = ^Word;
IdentPtr = ^IdentRec;
IdentRec = record
Ident: string[15];
RefCount: Word;
Next: IdentPtr;
end;