Clicky

Fortran Wiki
c_f_procpointer (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

c_f_procpointer(cptr, fptr) (削除) Assign (削除ここまで)(追記) assigns (追記ここまで) the target of the C function pointercptr to the Fortran procedure pointer fptr.

(削除)

Note: Due to the currently lacking support of procedure pointers in GNU Fortran this function is not fully operable.

(削除ここまで)
(削除) (削除ここまで)

Standard

(削除) Fortran 2003 and later (削除ここまで)(追記) Fortran 2003 (追記ここまで)(追記) and later (追記ここまで)

Class

Subroutine

Syntax

call c_f_procpointer(cptr, fptr)

Arguments

  • cptr - scalar of the type c_funptr. It is intent(in).
  • fptr - procedure pointer interoperable with cptr. It is intent(out).

Example

program main
 use iso_c_binding
 implicit none
 abstract interface
 function func(a)
 import :: c_float
 real(c_float), intent(in) :: a
 real(c_float) :: func
 end function
 end interface
 interface
 function getIterFunc() bind(c,name="getIterFunc")
 import :: c_funptr
 type(c_funptr) :: getIterFunc
 end function
 end interface
 type(c_funptr) :: cfunptr
 procedure(func), pointer :: myFunc
 cfunptr = getIterFunc()
 call c_f_procpointer(cfunptr, myFunc)
end program main

See also

c_loc, c_f_pointer (追記) , (追記ここまで)(追記) iso_c_binding (追記ここまで)

category: (削除) Intrinsics (削除ここまで)(追記) intrinsics (追記ここまで)

Revised on April 29, 2009 11:14:55 by Jason Blevins (71.70.142.190) (1132 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, c_f_pointer, c_funloc, c_loc, C interoperability, iso_c_binding

AltStyle によって変換されたページ (->オリジナル) /