Switching streams?

This is a discussion on Switching streams? within the C++ Programming forums, part of the General Programming Boards category; Having a bit of trouble making my program work.
I am trying to get a stream that I can assign ...

However, I get erros when doing this that all the constructors and assignment operators for istream are "private within this context". I'm not qute sure what that means, but it won't let me use it later on.

Does anyone have experience with this kind of thing?

Also, it needs to be a stream, not a file pointer, so freopen() won't work.

With no arguments it works properly, and if I remove the argument handling and cin and cout and go straight from file to file it works, reading chars, translating them through avix() and then outputting them to a file or cout.

But this way I either get a segmentation fault or no effect, it is has any args. (But calling it without args works perfectly)

On a related note, does anyone know how to send EOF down cin? Or is there an end iterator for an input stream that I am overlooking? On files that transform() worked fine (with an fstream) but when input comes from cin it keeps taking more and more characters until I shut it down from outside.