Destroys an object of class basic_ostream.
virtual ~basic_ostream();
Removes a basic_ostream object from memory.
// The ewl-test file contains originally // CodeWarrior "Software at Work" #include <iostream> #include <fstream> #include <cstdlib> char inFile[] = "ewl-test"; int main() { using namespace std; ifstream inOut(inFile, ios::in | ios::out); if(!inOut.is_open()) {cout << "Could not open file"; exit(1);} ostream Out(inOut.rdbuf()); char str[] = "\nRegistered Trademark"; inOut.rdbuf()->pubseekoff(0, ios::end); Out << str; inOut.close(); return 0; }
Result:
The File now reads: CodeWarrior "Software at Work" Registered Trademark