POINTER variable and attribute
A pointer variable is declared contextually if it appears in the declaration of a based variable, as a locator qualifier, in a BASED attribute, or in the SET option of an ALLOCATE, LOCATE, READ, or FETCH statement. It can also be declared explicitly.
Abbreviation: PTR
- 32
- A POINTER(32) is four bytes in size and by default fullword-aligned.
- 64
- A POINTER(64) is eight bytes in size and by default doubleword-aligned.
If the LP(32) compiler option is in effect, the default is POINTER(32); if the LP(64) compiler option is in effect, the default is POINTER(64). POINTER(64) is valid only under LP(64).
Assigning a POINTER(32) to a POINTER(64) is always valid; the reverse is valid only if the first four bytes of the POINTER(64) are zero.
The value of a pointer variable that no longer identifies a generation of a based variable is undefined (for example, when a based variable has been freed). Before a reference is made to a pointer-qualified variable, the pointer must have a value.
