stdio文件常用函数
#include <stdio.h>
#include <conio.h>
#include <io.h>
void flush(FILE *stream);
int main()
{
FILE *stream;
char msg[]="This is a test";
stream=fopen("DUMMY.FIL","w");
fwrite(msg,strlen(msg),1,stream);
clrscr();
printf("Press any key to flush DUMMY.FIL:");
getch();
flush(stream);
printf("File was flushed,Press any key to quit:");
getch();
return 0;
}
void flush(FILE *stream)
{
int duphandle;
fflush(stream);
duphandle=dup(fileno(stream));
close(duphandle);
}
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新教学研究stdio文件函数详解(4)全文阅读和word下载服务。
相关推荐: