Intel® Fortran Compiler 16.0 User and Reference Guide
Intrinsic Module Subroutine: Associates a pointer with the target of a C pointer and specifies its shape.
USE, INTRINSIC :: ISO_C_BINDING
CALL C_F_POINTER(cptr, fptr [,shape])
cptr |
(Input) Is a scalar of derived type C_PTR. Its value is the C address of an interoperable data entity, or the result of a reference to function C_LOC with a noninteroperable argument. If the value of cptr is the C address of a Fortran variable, it must have the TARGET attribute. |
fptr |
(Output) Is a pointer. If it is an array, shape must be specified. |
shape |
(Optional, input) Must be of type integer and rank one. Its size equals the rank of fptr. |
If the value of cptr is the C address of an interoperable data entity, fptr must be a pointer with type and type parameters interoperable with the type of the entity. In this case, fptr becomes pointer-associated with the target of cptr.
If fptr is an array, it has the shape specified by shape and each lower bound is 1.
If the value of cptr is the result of a reference to C_LOC with a noninteroperable argument x, the following rules apply:
C_LOC argument x (or its target) must not have been deallocated or have become undefined due to the execution of a RETURN or END statement since the reference to C_LOC.
fptr is a scalar pointer with the same type and type parameters as x. fptr becomes pointer-associated with x, or it becomes pointer-associated with its target if x is a pointer.