贺老师的原帖:http://blog.csdn.net/sxhelijian/article/details/46428701
今天自己试了一下 顺便学了一下CMD命令
cd+空格+文件地址可以跳转
cd 则回到根目录
cd/ 回到C盘
代码如下
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
char arv;
if (argc<3)
{
cerr<<"you must provide the source and target file.\n";
exit(1);
}
ifstream infile(argv[1],ios::in);
ofstream outfile(argv[2],ios::out);
while (infile.get(arv))
outfile.put(arv);
infile.close();
outfile.close();
}
运行结果