zoukankan      html  css  js  c++  java
  • 有关文件操作的总结

    freopen

    基本用法:freopen("文件名.拓展名","操作种类(我反正只知道有r&w)","标准输入输出");

        如果想重新用键盘屏幕输入输出,可以:freopen("CON","r或w","stdin或stdout");

    几个简单的性质:

      1、stdin和stdout同时只能对应一个输入/输出的位置,即若freopen("test.in","r","stdin");后再写一条:freopen("data.in","r","stdin");那么test.in就会直接关闭,从data.in读取。同理stdout也一样。

       2、当使用freopen("xxx.xxx","w","stdout")时会先把xxx.xxx中的内容删除,应注意。 只有当stdout被成功关闭(fclose(stdout);或函数返回)是xxx.xxx才能保存输入的内容。(中途崩溃或调试时没有关闭就停止执行的话xxx.xxx的内容好像就会丢失的说)

       3、文件也可以是cpp或是exe类型的,不过只会把它当文本文件对待(不会运行的)

  • 相关阅读:
    与DSP通信时,RD&WR信号
    4.2.1 Vector bit-select and part-select addressing
    数据校验
    数据结构 (树,图)
    ASOP编译说明
    os
    20180203-增与查
    yum安装MariaDB
    20180202之engine,URL,base,session
    列表
  • 原文地址:https://www.cnblogs.com/InductiveSorting-QYF/p/11022441.html
Copyright © 2011-2022 走看看