Sign in

docs ILE Concepts

Pointer Support in C and C++ Compilers

Pointer Support in C and C++ Compilers

To take full advantage of 8-byte pointers when you compile your code with the IBM® C or C++ compiler, specify STGMDL(*TERASPACE) and DTAMDL(*LLP64).

The C and C++ compilers also provide the following pointer support:

  • Syntax for explicitly declaring 8- or 16-byte pointers:
    • Declare a 8-byte pointer as char * __ptr64
    • Declare a 16-byte pointer as char * __ptr128
  • A compiler option and pragma for specifying the data model, which is unique to the C and C++ programming environment. The data model affects the default size of pointers in the absence of one of the explicit qualifiers. You have two choices for the data model:
    • P128, also known as 4-4-161
    • LLP64, also known as 4-4-82

1 Where 4-4-16 = sizeof(int) – sizeof(long) – sizeof(pointer)

2 Where 4-4-8 = sizeof(int) – sizeof(long) – sizeof(pointer)