Passing data between C++ and COBOL
- By reference (indirect)
- COBOL BY REFERENCE
- By value (indirect)
- COBOL BY CONTENT
- 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.