Sun Studio 12: Fortran Library Reference

2.2.2 C Binding Module

The Fortran 2003 standard provides a means of referencing C language procedures. The ISO_C_BINDING module defines three support procedures as intrinsic module functions. Accessing these functions requires

USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_LOC, C_PTR, C_ASSOCIATED

in the calling routine. The procedures defined in the module are

Function  

Description  

C_LOC(X)

Returns the C address of the argument 

C_ASSOCIATED(C_PTR_1 [, C_PTR_2])

Indicates the association status of C_PTR_1 or indicates whether C_PTR_1 and C_PTR_2 are associated with the same entity.

C_F_POINTER(CPTR, FPTR [, SHAPE])

Associates a pointer with the target of a C pointer and specifies its shape. 

For details on the ISO_C_BINDING intrinsic module, see Chapter 15 of the Fortran 2003 standard at http://www.j3-fortran.org/.