Next: C_F_PROCPOINTER, Previous: C_ASSOCIATED, Up: Intrinsic Procedures
C_F_POINTER — Convert C into Fortran pointerC_F_POINTER(cptr, fptr[, shape]) Assign the target the C pointer
cptr to the Fortran pointer fptr and specify its
shape.
     CALL C_F_POINTER(cptr, fptr[, shape])
     | cptr | scalar of the type C_PTR. It isINTENT(IN). | 
| fptr | pointer interoperable with cptr. It is INTENT(OUT). | 
| shape | (Optional) Rank-one array of type INTEGERwithINTENT(IN). It shall be present
		       if and only if fptr is an array. The size
		       must be equal to the rank of fptr. | 
          program main
            use iso_c_binding
            implicit none
            interface
              subroutine my_routine(p) bind(c,name='myC_func')
                import :: c_ptr
                type(c_ptr), intent(out) :: p
              end subroutine
            end interface
            type(c_ptr) :: cptr
            real,pointer :: a(:)
            call my_routine(cptr)
            call c_f_pointer(cptr, a, [12])
          end program main