extern "FORTRAN" { double cfort(double); } #include <stdio.h> main() { double x, y; x=12.5; y=cfort(x); printf ("Value returned to C: %f\n", y); }
FUNCTION CFORT ( ARG ) REAL*8 CFORT REAL*8 ARG PRINT *, 'FORTRAN ARG VALUE:', ARG CFORT = ARG END
extern "FORTRAN" { double cfort(double &);; } #include <stdio.h> main() { double x, y; x=12.5; y=cfort(x); printf ("Value returned to C: %f\n", y); }