c++ - io operation using same stream object -
I want to take I / O action in C ++. I want to store an indicator in the fstream object and the same fast I want to read and write that file. Is it possible to read the Eastream without using two different objects and for the offstream?
Yes, Fistruff
can be used to read and write. Do you want to accomplish this?
// your fstream object std :: fstream a ("coco.txt"); // Buffer Cherry Foo [100]; // a & lt; & Lt; "Hello" & lt; & Lt; Write endl; // rewards a.seekg (0, iOS :: bakh); // One & gt; & Gt; Foo; // display std :: cout & lt; & Lt; Foo; // clear a.close ();
Comments
Post a Comment