⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11-4-2-3.cpp

📁 学习c++的ppt
💻 CPP
字号:
#include <fstream.h>
#include <stdlib.h>
void main()
{     ifstream sfile("abc.txt");
      ofstream dfile("result.txt");
      char ch;
      if(!sfile)  
      {   cout<<"不能打开源文件:"<<endl; exit(1);	}
      if(!dfile)
      {   cout<<"不能打开目标文件:"<<endl;exit(1); }
      sfile.unsetf(ios::skipws);  //关键! 把跳过空白控制位置0,
                                  //          即不跳过空白,否则空白全部未拷贝
      while(sfile>>ch) 
            dfile<<ch;
      sfile.close(); //如没有这两个关闭函数,析构函数也可关闭
      dfile.close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -