Question: Re - code the following portion of main ( ) so that it accepts a single command - line parameter that identifies the external file
Recode the following portion of main so that it accepts a single commandline parameter that identifies the external file name of the file being opened, instead of the constant string that's currently being passed in In addition, add error checking using trythrowcatch to ensure that the user typed exactly two commandline parameters this includes the program name and the file name That is convert the following fragment to use commandline parameters to open a file, with error checking. If there's an error, exit;
int main
ifstream infile;
infile.openscorestxt;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
