I'm running a program and redirecting cout
to an outfile, like so:
./program < infile.in > outfile.o
I want to be able to read in an option ('-h' or '--help') from the command line and output a help message to the terminal. Is there a way I can do this but still have the regular cout
from the rest of the program go to the outfile?
Would cout
be the right object to use for such a thing?