2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
8 C_F_POINTER --- Convert C into Fortran pointer
9 **********************************************
11 .. index:: C_F_POINTER, pointer, convert C to Fortran
13 .. function:: C_F_POINTER(CPTR, FPTR, SHAPE)
15 ``C_F_POINTER(CPTR, FPTR[, SHAPE])`` assigns the target of the C pointer
16 :samp:`{CPTR}` to the Fortran pointer :samp:`{FPTR}` and specifies its shape.
19 scalar of the type ``C_PTR``. It is
23 pointer interoperable with :samp:`{cptr}`. It is
27 (Optional) Rank-one array of type ``INTEGER``
28 with ``INTENT(IN)``. It shall be present
29 if and only if :samp:`{fptr}` is an array. The size
30 must be equal to the rank of :samp:`{fptr}`.
33 Fortran 2003 and later
39 .. code-block:: fortran
41 CALL C_F_POINTER(CPTR, FPTR[, SHAPE])
44 .. code-block:: fortran
50 subroutine my_routine(p) bind(c,name='myC_func')
52 type(c_ptr), intent(out) :: p
58 call c_f_pointer(cptr, a, [12])
63 :ref:`C_F_PROCPOINTER`