- 论坛徽章:
- 0
|
原帖由 cjaizss 于 2008-2-20 17:40 发表
无论如何,标准I/O的输入输出之间要刷新流,这是C语言标准的规定。
严重同意:
7.19.5.3 The fopen function
Synopsis
1
#include <stdio.h>
FILE *fopen(const char * filename, const char * mode);
Description
...
6 When a file is opened with update mode (’+’ as the second or third character in the
above list of mode argument values), both input and output may be performed on the
associated stream. However, output shall not be directly followed by input without an
intervening call to the fflush function or to a file positioning function (fseek,
fsetpos, or rewind), and input shall not be directly followed by output without an
intervening call to a file positioning function, unless the input operation encounters endof-
file. Opening (or creating) a text file with update mode may instead open (or create) a
binary stream in some implementations. |
|