Passing strings between C++ and COBOL
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.