C语言库函数 fflush
来源:互联网 发布:基础款卫衣推荐知乎 编辑:程序博客网 时间:2024/05/17 04:15
函数名: fflush
功 能: 清除一个流
用 法: int fflush(FILE *stream);
程序例:
#include <string.h>
#include <stdio.h>
#include <conio.h>
#include <io.h>
void flush(FILE *stream);
int main(void)
{
FILE *stream;
char msg[] = "This is a test";
/* create a file */
stream = fopen("DUMMY.FIL", "w");
/* write some data to the file */
fwrite(msg, strlen(msg), 1, stream);
clrscr();
printf("Press any key to flush/
DUMMY.FIL:");
getch();
/* flush the data to DUMMY.FIL without/
closing it */
flush(stream);
printf("/nFile was flushed, Press any key/
to quit:");
getch();
return 0;
}
void flush(FILE *stream)
{
int duphandle;
/* flush the stream's internal buffer */
fflush(stream);
/* make a duplicate file handle */
duphandle = dup(fileno(stream));
/* close the duplicate handle to flush/
the DOS buffer */
close(duphandle);
}
- C语言库函数 fflush
- c 语言函数 fflush()
- C语言 -- fflush()
- C语言 -- fflush()
- C语言fflush()函数
- C语言中的fflush函数
- C语言中的fflush函数
- C/C++语言误区之:fflush(stdin)
- 关于C语言输出问题----fflush (stdin);
- c语言fflush(stdin)的重要性
- C/C++语言误区之:fflush(stdin)
- C语言中fflush函数的使用方法
- C语言中fflush函数的使用方法
- C语言中fflush函数的使用方法
- C语言fflush函数的移植问题
- C语言函数随记:fflush()函数
- C语言库函数介绍
- C语言库函数
- 荷兰疑似操控比赛做球 两场淘汰赛皆有疑点
- 主从mysql replication 集群的sharding memcache集群使用consistent hash
- fprintf() 函数简介
- getenv函数
- 定义类的属性方法
- C语言库函数 fflush
- ClearCase完全攻略(四) UCM下的一些概念全解析2
- 到深圳出差
- 完整的seo阐述
- [翻译]gcc internals 4.6.0:Introduction
- 指向const对象的指针&&&const指针
- 如何在struts2中登录后跳转到前置页面
- Tomcat配置不同二级域名间session共享
- 【转】LCD1602演示程序