Redian新闻
>
如何往一个文件里续写数据
avatar
如何往一个文件里续写数据# Computation - 科学计算
q*z
1
现在要运行一个loop,分成好多段,每一段执行后都往文件里写数据,请问如何才能接
着以前的往下写.谢谢!!
avatar
T*r
2
what language?
in fortran, u need to define the data file and open it first
then write to it
open(77,status="old",file="urdata.dat")
at the end of calculation use
write(77,*) ur x, ur y
this 77 is just an example, u can use other number
but better choose something greater than 20

【在 q***z 的大作中提到】
: 现在要运行一个loop,分成好多段,每一段执行后都往文件里写数据,请问如何才能接
: 着以前的往下写.谢谢!!

avatar
x*l
3
C里面只要你中间不关闭文件,调用文件指针,就是接着写的。

【在 T*********r 的大作中提到】
: what language?
: in fortran, u need to define the data file and open it first
: then write to it
: open(77,status="old",file="urdata.dat")
: at the end of calculation use
: write(77,*) ur x, ur y
: this 77 is just an example, u can use other number
: but better choose something greater than 20

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。