Some COBOL data types have C/C++ equivalents, but others do not. When you pass data between COBOL programs and C/C++ functions, be sure to limit data exchange to appropriate data types.
By default, COBOL passes arguments BY REFERENCE. If you pass an argument BY REFERENCE, C/C++ gets a pointer to the argument. If you pass an argument BY VALUE, COBOL passes the actual argument. You can use BY VALUE only for the following data types:
In C/C++, you can call a program with a varying number of parameters by using the va_start, va_arg, and va_end macros to manage the variable aspect of the parameter list. You need to know how the called program determines the end of the parameter list, however. For example, some programs look for a null pointer to signify the end of the list. COBOL does not terminate the parameter list with a null pointer, but you can supply a null pointer by passing BY VALUE 0 as the last argument.
related tasks
Sharing data
related references
COBOL and C/C++ data types