Intel® Fortran Compiler 18.0 Developer Guide and Reference

C_F_POINTER

Intrinsic Module Subroutine: Associates a data pointer with the target of a C pointer and specifies its shape.

Module

USE, INTRINSIC :: ISO_C_BINDING

Syntax

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 data 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 data 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:

Since the resulting data pointer fptr could point to a target that was not allocated with an ALLOCATE statement, fptr cannot be freed with a DEALLOCATE statement.

See Also