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

📄 make_together.cpp

📁 是经典的UNIX的部分源代码
💻 CPP
字号:
/******************************************************************************************
* 辅助文件,用来将指定的文件写入映象文件的指定位置中
* 编写:谢煜波
* email:xieyubo@126.com
* 使用方法
* make_togethger 映象文件名 位置 欲写入的文件名
*******************************************************************************************/

#include <fstream>
#include <cstdlib>
#include <iostream>

using namespace std ;

int main( int argc , char** argv )
{
  char ch ;
  unsigned int count = 0 ;
  if( argc == 1 ){
    cout << "make_together object_file position source_file" ;
  }
  else{
    unsigned int pos = atoi( argv[ 2 ] ) ;
	  ofstream outfile( argv[ 1 ] , ios_base::in | ios_base::out ) ;
    outfile.seekp( pos ) ;  
    ifstream infile( argv[ 3 ] ) ;
    while( infile.get( ch ) ){
      outfile.put( ch ) ;
    }
    infile.close() ;
    outfile.close() ;
  }
}

⌨️ 快捷键说明

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