找回密码
 注册
Simdroid-非首页
查看: 60|回复: 1

请教matalb中fprintf的使用问题

[复制链接]
发表于 2011-8-14 12:42:36 | 显示全部楼层 |阅读模式 来自 清华大学学生宿舍
向各位高手请教:

如果在不同的函数(也就是不同的m文件)中用fprintf向文件mat.txt中多次写入,并且每次写入能够在上次的基础上继续写,应该怎么实现呢?我现在的问题是,在第一个m文件中写完后,第二个m文件再写的话就把第一次写的内容覆盖了。

谢谢!
发表于 2011-8-14 16:19:12 | 显示全部楼层 来自 山东烟台
Simdroid开发平台
回复 1# jilindax
fopen的属性:
  1. 'r'
  2.        

  3. Open file for reading (default).

  4. 'w'
  5.        

  6. Open or create new file for writing. Discard existing contents, if any.

  7. 'a'
  8.        

  9. Open or create new file for writing. Append data to the end of the file.

  10. 'r+'
  11.        

  12. Open file for reading and writing.

  13. 'w+'
  14.        

  15. Open or create new file for reading and writing. Discard existing contents, if any.

  16. 'a+'
  17.        

  18. Open or create new file for reading and writing. Append data to the end of the file.

  19. 'A'
  20.        

  21. Append without automatic flushing. (Used with tape drives.)

  22. 'W'
  23.        

  24. Write without automatic flushing. (Used with tape drives.)
复制代码

评分

1

查看全部评分

回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-5-21 19:51 , Processed in 0.032704 second(s), 15 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表