作者Gwaewluin (神无月 孝臣)
看板Fortran
标题[问题] 基本的记忆体配置问题
时间Thu Feb 19 13:50:05 2009
我在主程式设了个矩阵叫做A
然後A要传给subroutine去用
所以我在subrontine里面设了个B
假设最後变成这样
program main
integer A(x,x,x)
call sub(A)
end
subroutine sub(B)
integer B(x,x,x)
end subroutine
A和B都是同样的内容
所以请问我是宣告了两个一样大小容量的矩阵吗?
使用上是A的资料放进去B里面这样?
还是说只有开一个这麽大容量的矩阵?
B其实是直接使用A里面的内容?
总觉得记忆体使用上感觉有点困惑
不知道在subroutine里面会不会把一样的资料又多用一次记忆体空间
如果真的是这样的话以後就尽量不要使用subroutine好了
--
Deserves death! I daresay he does. Many that live deserve death. And some die
that deserve life. Can you give that to them? Then be not too eager to deal out
death in the name of justice, fearing for your own safty. Even the wise cannot
see all ends.
Gandalf to Frodo
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.120.25.235