Microsoft Windows* 8.x

BIND(C)

Fortran 2003 introduced the language-binding-spec attribute, using the keyword BIND. The syntax is:

BIND(C [, NAME=scalar-default-char-constant-expr])

C is the only language name you can specify. Generally, an entity with the BIND(C) attribute behaves as if it were the corresponding entity in the companion C processor.

Characters

The C language does not have character strings. Instead, it has arrays of single characters, so this is how you must represent a character string in Fortran.

There is a kind value defined, C_CHAR, corresponding to the C char type. However, only character variables with a length of one (1) are interoperable.

Pointers

For interoperating with C pointers, the module ISO_C_BINDING contains the derived types C_PTR and C_FUNPTR, which are interoperable with C object and function type pointers, respectively.

Variables

A scalar Fortran variable is interoperable if its type and type parameters are interoperable and it is not a pointer.

An array Fortran variable is interoperable if its type and type parameters are interoperable and it has an explicit shape or assumed size. It interoperates with a C array of the same type, type parameters, and shape, but with subscripts reversed.

Iscriversi a Microsoft Windows* 8.x