1.

Solve : Sorry, Nm the topic below this!!! I need help reading from a certain file in C++?

Answer»

Hi. My name is Tim and i need some help in reading from a certain FILE with the following format: 56 38 A 7 8. The 56 & the 38 are on the first line, A is on the second, and 7 & 8 are on the third line. What I'm TRYING to do is to make a program that will read this from a file called "inData.txt" without the quotes, and to read this to a file called "outData.txt". This is my program that I can't get to work the way I WANT it to : #include <iostream>
#include <fstream>
#include <string>
using namespace std;

INT main()
{
string line;
bool choice;
ifstream inFile ("inData.txt");
ofstream outFile ("outData.txt");

choice = false;
GETLINE(inFile, line);
cout<<line<<endl;
outFile<<line<<endl;

inFile.close();
outFile.close();

return 0;
}

...And this is in C++. All comments are appreciated. Thx for the help sorry, the "#include " should be on the top of the code



Discussion

No Comment Found