C语言二进制文件数据不见了

2025-02-27 02:32:08
推荐回答(2个)
回答1:

不是路径问题。
读取时应该用
fopen("yong","rb")

回答2:

楼主看下MSDN就清楚了。打开格式问题。"wb"会销毁文件的内容,见下。

"r"
Opens for reading. If the file does not exist or cannot be found, thefopencall fails.
"w"
Opens an empty file for writing. If the given file exists, its contents are destroyed.
"a"
Opens for writing at the end of the file (appending) without removing the EOF marker before writing new data to the file; creates the file first if it doesn’t exist.