| |
|
|
|
|
|
정보의 바다에서 헤엄치다 익사하기 직전,
정말 어처구니 없는 사실을 알게 됬다.
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.
[ * ISO/IEC 9899:1999 Programming Language - C ]
fflush() 함수는 입출력 버퍼를 비우는데 사용해 왔는데,
이놈의 함수가 Output Stream 을 비우도록 정의되어 있지만...그 반대의 경우..
즉, Input Stream 에 관해서는 그 어떤 행동도 정의되어 있지 않다는 것이다.
한마디로...플랫폼 따라~ 벤더 따라~ 지멋대로.
어쩐지.....scanf 이후에 fflush 써도 안먹히던 이유가 있었다.
|
|
| Track this back : http://blog.rhkorea.com/superfantastic/trackback/30 |
|
|
|
|
|
«
2008/11
»
| 일 |
월 |
화 |
수 |
목 |
금 |
토 |
| |
|
|
|
|
|
1 |
| 2 |
3 |
4 |
5 |
6 |
7 |
8 |
| 9 |
10 |
11 |
12 |
13 |
14 |
15 |
| 16 |
17 |
18 |
19 |
20 |
21 |
22 |
| 23 |
24 |
25 |
26 |
27 |
28 |
29 |
| 30 |
|
|
|
|
|
|
|
Total : 31654
Today : 28
Yesterday : 42 |
|
|
 |
 |
 |
|