【发布时间】:2021-11-27 08:23:42
【问题描述】:
何时在Text Mode 或Binary Mode 中打开文件我有点困惑。我阅读了一些文档和示例,发现它在Text Mode 和Binary Mode 中使用了getc()-putc() 或fgets()-fputs()。我可以在Text Mode 中打开一个文件以使用fread()-fwrite(),或者我应该只将Binary Mode 用于像fread()-fwrite() 这样的二进制I/O 函数。
要使用fseek(),ftell()应该使用Text Mode或Binary Mode哪个模式?
我正在使用C 编程语言和Linux 发行版(fedora)。
【问题讨论】:
-
Linux上没有区别。
标签: c file-io fgets fread stdio