I am working on a program and thought I have it coded correctlybut having an iss
ID: 3617190 • Letter: I
Question
I am working on a program and thought I have it coded correctlybut having an issue...Here are my instructions...can one of u guystake a look....im really not even sure how to start the secondquestion...#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
//Start main
int main()
{
string filename = "exam.txt"; // Create Var tohold file name
char inputline[80]; // Buffer to hold line justread
ifstream inFile; // Input file object
// Open the input file.
inFile.open("exam.txt");
// Test for errors.
if (!inFile)
{
cout << "Error opening" << filename << endl;
exit(EXIT_FAILURE);
}
// Read through file & list names
// Read and process the input file.
while (!inFile.eof())
{
// Read the string frominFile.
inFile.getline(inputline, 80,' ');
// Display the line.
cout << inputline<< endl;
}
return 0;
}
here are the instructions
1 take the application you developed in class (the one where youcreated a file, read in the data then displayed the data.
2 Add the following
a. add a data structure to hold the data
b. read in the data from the input file
c. store the data in the data structure
d. write the data to a output file!
Explanation / Answer
any ideas on this???
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.