Passing data between C++ and COBOL

In VS COBOL II and COBOL/370, you can pass parameters two ways:
By reference (indirect)
COBOL BY REFERENCE
By value (indirect)
COBOL BY CONTENT
In Enterprise COBOL for z/OS, COBOL for OS/390 & VM, and COBOL for MVS & VM, you can pass parameters three ways:
By reference (indirect)
COBOL BY REFERENCE
By value (indirect)
COBOL BY CONTENT
By value (direct)
COBOL BY VALUE

Under Language Environment, the term by value means that a temporary copy of the argument is passed to the called function or procedure. Any changes to the parameter made by the called routine will not alter the original parameter passed by the calling routine. Under Language Environment, the term by reference means that the actual address of the argument is passed. Any changes to the parameter made by the called routine can alter the original parameter passed by the calling routine.

Further, the term direct means that the argument is passed in the parameter list. The term indirect means that a pointer to the argument is passed in the parameter list.

There are two ways to pass data between C++ and COBOL; one way uses extern "C" in the C linkage, and the other uses extern "COBOL". Both methods are discussed separately in the following sections.