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.
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.