z/OS Language Environment Writing Interlanguage Communication Applications
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Passing pointers from PL/I to C++

z/OS Language Environment Writing Interlanguage Communication Applications
SA38-0684-00

Pointers to various data objects can be passed from PL/I and accepted by a function written in C++.

An extra level of indirection is added when passing a pointer value from PL/I to C++, because the C++ extern "PLI" linkage specification passes pointers directly. If PL/I passes or returns a pointer to a type, C++ receives a pointer to a pointer to the type.

PL/I parameters that require a locator or descriptor should not be passed directly. This includes parameters that are structures, arrays, or strings. These parameters can be passed indirectly from PL/I by using a pointer to the associated data. For more information about data descriptors, see the IBM Enterprise PL/I for z/OS library.

The non-address bits in all fullword pointers declared in PL/I source code should always be zero. If they are not, results are unpredictable.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014