Question: C++ reading input from argv. For the function computeGradeAndPrint(string filename), how would I read the input of the file into a vector? The file will
C++ reading input from argv.
For the function computeGradeAndPrint(string filename), how would I read the input of the file into a vector?
The file will contain lines of text.
Please see the main function to see that filename contains argv[1] (a text file)
#include
using namespace std;
void computeGradeAndPrint(string filename) {
}
int main(int argc, char ** argv) { if (argc < 2) return -1;
string filename(argv[1]); computeGradeAndPrint(filename);
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
