What's the best way to dynamically use different stream sources and targets, including the standard console streams and files?
What are the types of std::cin and std::cout ?
Write an ECHO program that simply echoes its input and that can be invoked equivalently in the two following ways:
ECHO <infile >outfile ECHO infile outfile
In most popular command-line environments, the first command assumes that the program takes input from cin and sends output to cout . The second command tells the program to take its input from the file named infile and to produce output in the file named outfile . The program should be able to support all of the above input/output options.