One of the things I liked about C io <stdio.h> was that a program
could do things on a stream without knowing if it was connected to a file
or to a standard stream (stdin, stdout & stderr).
This is very useful for writing a program like more which can either
pick up a file from the command line and open it or take standard input.
What is the best way of getting the same effect in C++ where, for
example, cin is a different class (istream) from a file opened for input
I cannot find anything in Stroustrup so I have thought of some ways
myself but they are not very elegant!
Thanking you in advance for your time,