program Test
implicit none
integer(4),allocatable,target:: a(:,:,:), b(:,:,:)
integer(4), pointer::p(:,:,:)
allocate(a(1024,1024,10),b(1024,1024,10)) !大小各40M
a=0
b=1
p=>b !任务管理器显示使用91M
a=p !内存使用 131M。如果数组过大,会栈溢出
write(*,*) a(1,1,1)
pause
end program Test
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |