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


Passing data between C++ and COBOL with extern "COBOL"

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

Note: The reference to COBOL with extern "COBOL", applies to VS COBOL II, COBOL/370, COBOL for MVS & VM, COBOL for OS/390 & VM, and Enterprise COBOL for z/OS.

When data is passed between XL C++ and COBOL with extern "COBOL", the C++ compiler generates the appropriate addressing code which introduces an extra level of indirection on the C++ side for non-pointer types. Pointers, however, are passed directly; meaning that for COBOL to receive a pointer to a C++ data type, C++ must pass a pointer to a pointer to the C++ data type. Conversely, if COBOL returns a pointer to a data type, C++ receives a pointer to a pointer to the data type.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014