请教一个文件open函数的问题

C、C++和Java语言
回复
头像
gordonyb0
帖子: 61
注册时间: 2005-10-18 11:24
来自: 苏州
送出感谢: 0
接收感谢: 0
联系:

请教一个文件open函数的问题

#1

帖子 gordonyb0 » 2006-06-11 21:52

我想每次向文件写入时都覆盖以前的内容,不知道open()的flag应该选哪个?
They are both convined
that a sudden passion joined them
such certainty is beautiful
but uncertainty is more beautiful still
boliang319
帖子: 50
注册时间: 2006-03-17 20:06
送出感谢: 0
接收感谢: 0
联系:

#2

帖子 boliang319 » 2006-06-13 23:36

没看懂你的意思,是不是要以追加的方式打开文件啊?
可以用openf(filename,"a")或者openf(filename,"ab")
具体差别可以去查查C语言的书。
头像
gordonyb0
帖子: 61
注册时间: 2005-10-18 11:24
来自: 苏州
送出感谢: 0
接收感谢: 0
联系:

#3

帖子 gordonyb0 » 2006-06-14 17:07

我说的是fifo文件
They are both convined
that a sudden passion joined them
such certainty is beautiful
but uncertainty is more beautiful still
头像
gordonyb0
帖子: 61
注册时间: 2005-10-18 11:24
来自: 苏州
送出感谢: 0
接收感谢: 0
联系:

#4

帖子 gordonyb0 » 2006-06-14 17:08

问题解决了,用memset()
They are both convined
that a sudden passion joined them
such certainty is beautiful
but uncertainty is more beautiful still
回复

回到 “C/C++/Java”