Fortran 2003 Standard

BIND

Purpose

The BIND attribute declares that a Fortran variable or common block is interoperable with the C programming language.

Syntax

Read syntax diagramSkip visual syntax diagram                                                           .-,---------------------------.
                                                           V                             |
>>-BIND--(--C--+-----------------------------+--)--+----+----+-variable_name-----------+-+-><
               '-,--NAME-- = --binding_label-'     '-::-'    '-/--common_block_name--/-'
 
binding_label
is a scalar character initialization expression

Rules

This attribute specifies that a Fortran variable or common block is interoperable with a C entity with external linkage. Refer to Interoperability of Variables and Interoperability of common blocks for details.

If the NAME= specifier appears in a BIND statement, then only one variable_name or common_block_name can appear.

If a BIND statement specifies a common block, then each variable of that common block must be of interoperable type and type parameters, and must not have the POINTER or ALLOCATABLE attribute.

Table 29. Attributes compatible with the BIND attribute

Related information

End of Fortran 2003 Standard