#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), , stream);
    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();
    ;
}

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);
}

#include <stdio.h>
#include <stdlib.h>

int main(void){
    FILE *fp;
    if((fp=fopen("test", "rb"))==NULL) {
        printf("Cannot open file.\n");
        exit();
    }
    char ch = 'C';
    int i;
    ; i<; i++) {
        fwrite(ch, , fp);
        fflush(fp);
    }
    fclose(fp);
    ;
 }

最新文章

  1. 腾讯QQ你的缓存策略应该改下了
  2. FTP多任务下载实现类
  3. 辐射4 中文武器命名方法, 不用winhex, 直接游戏内操作
  4. paip.中文 分词 -- 同义词大全整理
  5. kafka监控之KafkaOffsetMonitor
  6. Controlling How NSThread and NSRunLoop Exit
  7. Android学习四、Android中的Adapter
  8. Android取得屏幕的高度和宽度
  9. 原生应用native、Web应用、混合应用hybrid:3者的优缺点解析
  10. 爬虫关于ip管理池的应用
  11. SqlCommandBuilder类是如何构建T-Sql语句
  12. Git详细教程(3)---结合gitHub使用
  13. 浅谈python模块的导入操作
  14. Kali 安装 VMwaretools 时 “没有足够可有空间提取xxxxxx”
  15. foreach 使用 引用&amp; $value . 使用 unset($value)
  16. Flask-WTF表单的使用
  17. zTree重命名节点时,操作的那个dom(类似input框那个)怎么写
  18. windows下《Go Web编程》之Go工作空间
  19. DevExpress ChartControl控件实现图表【转】
  20. transparent 透明效果

热门文章

  1. 服务器或普通PC裸机安装 ESXI6.5
  2. java EE : http 协议响应头部信息验证
  3. lr关联抓有相同左右边界的动态值
  4. spring_150905_sqlmapclient
  5. 第一个ajax小demo
  6. BNUOJ 52503 Disdain Chain
  7. dalvik 基于 jvm 的改进
  8. noip2007树网的核
  9. POJ1716 贪心
  10. uoj22 【UR #1】外星人