extern "FORTRAN" { int cfort( int ); } #include <stdio.h> main() { int x, y; x=5; y = cfort(x); printf ("Value returned to C: %d\n", y); }
FUNCTION CFORT ( ARG ) INTEGER*4 CFORT INTEGER*4 ARG PRINT *, 'FORTRAN ARG VALUE:', ARG CFORT = ARG END
extern "FORTRAN" { int cfort( int & ); } #include <stdio.h> main() { int x, y; x=5; y = cfort(x); printf ("Value returned to C: %d\n", y); }