Is it possible in C++ to redirect stdin to string in C++?
Using freopen I can redirect stdin to file, so both scanf and cin will use a content of that file. Using manipulations with stringstream and cin.rdbuf() I can redirect cin to that string, so any call to cin will work with my string. BUT scanf will continue to work with previous input stream. I guess it is possible to do with Unix's pipes but it's not available under Windows.
Is it possible to solve this in a portable way?