我想获取数组指针的地址。原型代码如下:
program main
implicit none
type foo
integer, allocatable :: i(:)
integer j
end type
type(foo) a
integer, pointer :: ai(:)
ai => a%i
print *, "The address of a is ", loc(a)
print *, "The address of a%i is", loc(ai) ! <--- I expect the same address as a.
end program main
我的最终目标是通过数组指针的地址获取a
with的地址,因为它是 type(foo) 的第一部分。type(foo)
ai
i
提前致谢!
李