Reference no: EM132208456
Write a program in C++ that will accept command line options to use in the program.
Command line option 1 will be the program name.
Option 2 (if used) will be ‘-p' and that will print the keyword used in option 3.
Option 3 will be the keyword
Option 4 will be file input
Option 5 will be file output
Example:
with argv[2] (‘-p') ./test -p KEYWORD input.txt output.txt
without argv[2] ./test KEYWORD input.txt output.txt
So, recap, argv[2] (if used) will print argv[3] (KEYWORD).
If not used, the command line will just take name of program, keyword, input, and output file names.