Program www_fcode_cn
Implicit None
real , target ::x(3:5) = 3.1415954
real , pointer :: p(:)
p => x
call subp( p )
call subx( x )
contains
subroutine subp(x)
real , pointer :: x(:)
write(*,*) x , ubound(x) , lbound(x)
end subroutine subp
subroutine subx(x)
real :: x(:)
write(*,*) x , ubound(x) , lbound(x)
end subroutine subx
End Program www_fcode_cn
vvt 发表于 2017-2-23 18:36
是的。传的是地址。正是因为这一点,所以指针,在fortran里的应用并没有很高的必要性(与C相比)
然而,并 ...
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |