#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;
int getInputFileName(); //function to get and store content in file to vector
int getOutputFileName();
int main()
{
getInputFileName();
getOutputFileName();
}
int getInputFileName()
{
vector<Student> s;
ifstream input;
string inputFileName;
cout << "What is the name of the input file you are going to use: " << endl;
cin >> inputFileName;
input.open(inputFileName);
while (input.fail()) // check to see if inputFileName opened
{
cout << "Error! Incorrect file name." << endl;
cout << "Enter the correct name of the input file you want to use: " << endl;
cin >> inputFileName;
}
can someone help me in this for loop right here? I need to read the contents of the file into the vector s. I am a little confused on vectors because I was absent the day my professor went over them. I'm not sure how to read the file into vector. Please help and don't be too rough on me, thank you in advance!!
for(i = 0; i > )
}
int getOutputFileName()
{
ofstream output;
string outputFileName;
cout << "What is the name of the output file you are going to use: " << endl;
cin >> outputFileName;
output.open(outputFileName);
while (output.fail()) // check to see if inputFileName opened
{
cout << "Error! Incorrect file name." << endl;
cout << "Enter the correct name of the output file you want to use: " << endl;
}
}