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


Receiving reference parameters in C++

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

If a parameter is not enclosed in parentheses a PL/I routine will pass it by reference to a C++ routine. C++ should then receive the parameter as a pointer to the equivalent C++ type.

For example, if a C++ function named FROMPLI is to receive a parameter having the type int, the function prototype declaration looks like this:
int FROMPLI(int *i);
or
int FROMPLI(int &i);

A parameter passed from PL/I by reference may be received and used by C++ as a value parameter provided that its value is not altered. If the value of such a parameter is altered, the effect on the original PL/I variable is undefined.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014