void swap (fstream& x, fstream& y);
123456789101112131415
// swapping fstream objects #include <fstream> // std::fstream int main () { std::fstream foo; std::fstream bar ("test.txt"); swap(foo,bar); foo << "lorem ipsum"; foo.close(); return 0; }