Question
The program takes two command line arguments, the name of an input file that contains a set of integers and an integer. If the input
The program takes two command line arguments, the name of an input file that contains a set of integers and an integer.
If the input file does not exist then print an error message and exit the program.
If the file exists, then it is guaranteed to only contain valid integers.
Your program should split this input file into two separate files, one (named less.txt) containing
integers that are less than the threshold value specified on the command line, and one (named more.txt) containing the integers that are greater than the threshold value.
Both your output files, less.txt and more.txt, should print one number per line.
Note that you do not write any occurrences of the threshold value itself to either file.
./a.out myData 100 ./a.out noSuchFile 0
The file specified, noSuchFile, does not exist
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started