well, it can be done... if you're writing the operating system and it's compilers, but that's probably not the answer you wanted...
Since we're near the subject, I felt like writing an example as to how stream redirection can cut down on code by alot--especially when you need to write things to two files or print things to the screen and write them to a file.
of course, like this it won't be very useful, but if you rewrote the function to always output to everything you need, it just takes one function call to output to every target.
void print(std::ostream&out,const char*data);
void print(std::ostream&out,const char*data)