1234567891011121314151617
#include <iostream> #include <fstream> #include <string> using namespace std; int main() { fstream myfile; myfile.open("test.txt", ios::out); myfile.close(); return 0; }
12345678910111213141516171819
#include <iostream> #include <fstream> #include <string> using namespace std; int main() { fstream myfile; char ch = 'A'; myfile.open("test.txt", ios::out || ios::binary); myfile.write(&ch, sizeof(ch)); myfile.close(); return 0; }