Sun Studio 12: Fortran Programming Guide

11.9 Fortran 2003 Interoperability With C

The Fortran 2003 draft standard (available from http://www.j3-fortran.org) provides a means of referencing procedures and global variables defined by the C programming language from within a Fortran 95 program. And, conversely, provides a means for defining Fortran subprograms or global variables so that they can be referenced from C procedures.

By design, use of these features to accomplish interoperability between Fortran 95 and C programs insures portability across standards-conforming platforms.

Fortran 2003 provides the BIND attribute for derived types, and the ISO_C_BINDING intrinsic module. The module makes accessible to the Fortran program certain named constants, derived types, and procedures that support specification of interoperable objects. The details can be found in the Fortran 2003 standard.