14141| 4
|
[派生类型] 如何实现一个数据结构的共享(不同文件中) |
1F 币
最佳答案传递指针的话,需要用 interface,而书写到 module 里,可以避免手动书写 interface
[mw_shl_code=fortran,true]module typedef
Implicit None
type tttt
integer:: num
character(len=15) :: name1
end type tttt
end module typedef
module mod_struct_mod
use typedef
Implicit None
contains
subroutine mod_struct(struct)
type(tttt),pointer:: struct
struct%name1="xie"
end subroutine ...
| ||
| ||
![]() |
||
| ||
![]() |
||
| ||
| ||
捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )
GMT+8, 2025-10-12 05:53