Microsoft Windows* (XP, Vista, 7)


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.


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.


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.

Suscribirse a Microsoft Windows* (XP, Vista, 7)