flushall

flushall ,是一個編程函式,功能為清除所有緩衝區。

基本內容

函式名: _flushall

功 能: 清除所有緩衝區

用 法: int flushall(void);

程式例:

#include

int main(void) {

FILE *stream;

/* create a file */

stream = fopen("DUMMY.FIL", "w");

/* flush all open streams */

printf("%d streams were flushed.\n", _flushall());

/* close the file */

fclose(stream);

return 0;

}

程式示例

下面這個例子來自MSDN:

#include

int main( void )

{

int numflushed;

numflushed = _flushall();

printf( "There were %d streams flushed\n", numflushed );

return 0;

}

運行結果:

There were 3 streams flushed

Press any key to continue

相關詞條

相關搜尋

熱門詞條

聯絡我們