basic_filebuf<C,T>* basic_ofstream<C,T>::rdbuf() const;
#include <fstream>
#include <iostream>
#include <fstream>
int main() {
using namespace std;
// Open the output file stream for writing
basic_ofstream<char> qXoaXFile;
qXoaXFile.open("XoaX.txt");
// Use the buffer directly, if we so choose
if (qXoaXFile.rdbuf()->is_open()) {
// Write to the file
qXoaXFile << "XoaX.net";
qXoaXFile.close();
cout << "Wrote \"XoaX.net\" to the file \"XoaX.txt\"." << endl;
} else {
cout << "\"XoaX.txt\" failed to open" << endl;
return -1;
}
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.