- #1
Joon
- 85
- 2
Homework Statement
Write a program that can read an input file with a simple header.
The Attempt at a Solution
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream inFile;
inFile.open("Data"); //Check for error
if (inFile.fail()) {
cout << "Sorry, the file could not be opened." << "\n";
exit(1);
}
string c;
double x, y;
return 0;
}
<< Mentor Note -- added Code tags for readability >>
I'm not sure what to do next, would appreciate your help.
Attachments
Last edited by a moderator: