#include "stdafx.h"
#include<iostream>
#include<fstream>
#include<sstream>
using namespace std;
void main()
{
char c;
ifstream infile("d:\\lijiwei.txt");
if(!infile)
{
cout<<"can not open source file!"<<endl;
return;
}
ofstream outfile("d:\\lijiweibk.txt");
if(!outfile)
{
cout<<"can not open destination file!"<<endl;
return;
}
while(infile.get(c))
{
outfile.put(c);
}
cout<<"***file has been copied***"<<endl;
infile.close();
outfile.close();
return;
}
#include<iostream>
#include<fstream>
#include<sstream>
using namespace std;
void main()
{
char c;
ifstream infile("d:\\lijiwei.txt");
if(!infile)
{
cout<<"can not open source file!"<<endl;
return;
}
ofstream outfile("d:\\lijiweibk.txt");
if(!outfile)
{
cout<<"can not open destination file!"<<endl;
return;
}
while(infile.get(c))
{
outfile.put(c);
}
cout<<"***file has been copied***"<<endl;
infile.close();
outfile.close();
return;
}