Pointer types


 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.


The predefined type Pointer denotes an untyped pointer (a pointer that does not point to any specific type).


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.


 { Pointer Type Declaration }
   BytePtr  = ^Byte;
   WordPtr  = ^Word;
   IdentPtr = ^IdentRec;
   IdentRec = record
     Ident: string[15];
     RefCount: Word;
     Next: IdentPtr;

See Also

Тэги: PChar Pointer Types
| G+
Код для вставки: :: :: :: ::
Поделиться: // //