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


Passing strings between C++ and COBOL

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

C++ and COBOL have different string data types:
C++ strings
Logically unbounded length and are terminated by a NULL (the last byte of the string contains X'00')
COBOL PIC X(n)
Fixed-length string of characters of length n

You can pass strings between COBOL and C++ routines, but you must match what the routine interface demands with what is physically passed.

Enterprise COBOL for z/OS, COBOL for OS/390 & VM, and COBOL for MVS & VM have strings like previous COBOLs, as well as null-terminated literal strings like C++.

Refer to Sample ILC applications to see how string data is passed between C++ and COBOL.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014