Previous: 2.2.6.6. Real Types To the Table of Contents Next: 2.2.6.8. Pointer Dereference
2.2.6.6. Real Types Table of Contents 2.2.6.8. Pointer Dereference

- 2.2.6.7. -
Table of Contents
2. TMT Pascal Language Description
2.2. Pascal Language Structure
2.2.6. Types
2.2.6.7. Pointer Types


2.2.6.7. Pointer Types


Pointer types contain the address of an identifier or dynamically allocated memory. Pointer types require a double word (32 bits for storage). While in protected mode, pointers contain a 32-bit offset and the segment is assumed to be the data segment. Inthis way pointers are similar to the integer type Longint. To allocate dynamic variables see the chapter on Heap Management. A pointer type must point to specific type. Pointer types are defined as follows:
  ^Typename
The pointer type can be assigned the constant nil. When nil is assigned, the pointer does not refer to any location in memory. Pointer is a predefined pointer type that is untyped. Pointer is compatible with all other pointer types.

TMT Pascal supports the following arithmetical operations on pointers.

Examples:
  p2 := p1 + 1000;
  p1 := p2 - $FF;
  inc(p1, 15);
  dec(p2);
Where p1 and p2 are variables of Pointer Type.


Previous: 2.2.6.6. Real Types To the Table of Contents Next: 2.2.6.8. Pointer Dereference
2.2.6.6. Real Types Table of Contents 2.2.6.8. Pointer Dereference

- 2.2.6.7. -