Long time no blogging ! :)
I wanted to copy the contents of one file to another file in C++ in my project and was looking for the most easiest and convenient way of doing it on the net. Finally zeroed in on the following way (found it on some other blog):
#include <fstream>
using namespace std;
int main()
{
ifstream inFile("input.txt");
ofstream outFile("output.txt");
outFile << inFile.rdbuf();
return 1;
}
Thursday, May 29, 2008
Copying files in C++
Posted by Piyush Bhargava at 1:14 PM 0 comments
Labels: C++, copying files in C++, Technical
Subscribe to:
Posts (Atom)