Calling between COBOL and C/C++ programs
You can call functions written in C/C++ from COBOL programs and can call COBOL programs from C/C++ functions.
In an interlanguage application, you can combine 64-bit COBOL programs with 64-bit C/C++ functions, or 32-bit COBOL programs with 32-bit C/C++ functions.
- You cannot mix 32-bit components and 64-bit components in an application.
-q64options are not currently supported. Only 32-bit COBOL programs can be created at this time.
extern "C"in function prototypes for COBOL programs that are called from C++, and in C++ functions that are called from COBOL.
- In COBOL, use
BY VALUEparameters to match the normal C++ parameter convention.
- In C++, use reference parameters
to match the COBOL
The rules and guidelines referenced below provide further information about how to perform these interlanguage calls.
Unqualified references to "C/C++" in the referenced sections are to GNU GCC compiler.
Calling between COBOL and C/C++ under CICS
Passing data between COBOL and C/C++
Collapsing stack frames and terminating run units or processes