通过iso_c_binding从Fortran调用的C函数接收字符串,可以使用C的字符指针来传递字符串。iso_c_binding模块提供了一种机制,可以在Fortran和C之间进行数据交换。
以下是一种常见的方法:
use iso_c_binding
type(c_ptr) :: c_string
use iso_c_binding
type(c_char) :: c_char
use iso_c_binding
type(c_string) :: c_string
use iso_c_binding
type(c_size_t) :: c_size_t
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
use iso_c_binding
type(c_size_t), value :: c_strlen
use iso_c_binding
type(c_size_t), parameter :: c_strlen = c_size_t'kind'
use iso_c_binding
type(c_size_t) :: c_strlen(c_string)
领取专属 10元无门槛券
手把手带您无忧上云