C/C++ Programmer's Guide (G06.25+)
Mixed-Language Programming for TNS/R and
TNS/E Native Programs
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
8-27
Interfacing to Native COBOL
Example 8-1. C Program That Calls a COBOL Function
/* testc.c */
/* #pragma inspect, symbols */
/* #pragma search largec */
#include <stdio.h>
#include "cobincl.h"
short main (void)
{
short ds;
long dl;
char *tx = "Displayed in COBOL";
ds = 100;
dl = 40000;
XCOBFUNC(tx, &ds, &dl);
printf("I am back in C now and program is ending.\n");
}