/* * Main program for D compiled code * Hal Perkins 5/28/99 * * Contents: Standard get and put functions * Main program that evaluates (executes) D program */ #include extern int D_main(); /* main function in compiled code */ /* * Prompt for input, then return * next integer from standard input. */ int get() { int k; printf("get: "); scanf("%d", &k); return k; } /* Write x to standard output with a title and yield value of x */ int put(int x) { printf("put: %d\n", x); return x; } /* Execute D program D_main and print value returned */ void main() { printf("\nValue returned from D main: %d.\n", D_main()); }