Answer to Question #106 in C++ for alia
How to copy from an existing file to another one in C++?
1
2010-05-17T04:27:01-0400
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a;
fstream inputFile("C:\\TEMP\\samp1.txt");
fstream outputFile;
outputFile.open("C:\\TEMP\\samp2.txt");
while (!inputFile.eof()) {
inputFile >> a;
outputFile << a << endl;
}
outputFile.close();
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment