- 论坛徽章:
- 0
|
Problem:fflush(3) on different platforms
fflush should not be use in stdin, if you do that, the resoult is undefined.
原帖由 "ISO/IEC 9899:1999(E)" 发表:
7.19.5.2 The fflush function
Synopsis
1 #include <stdio.h>;
int fflush(FILE *stream);
Description
2 If stream points to an output stream or an update stream in which the most recent
operation was not input, the fflush function causes any unwritten data for that stream
to be delivered to the host environment to be written to the file; otherwise, the behavior is
undefined.
3 If stream is a null pointer, the fflush function performs this flushing action on all
streams for which the behavior is defined above.
Returns
4 The fflush function sets the error indicator for the stream and returns EOF if a write
error occurs, otherwise it returns zero.
Forward references: the fopen function (7.19.5.3). |
|