Answers for "create and write to a file c++19"

C++
30

create and write to a file c++19

// basic file operations
#include <iostream>
#include <fstream>
using namespace std;

int main () {
  ofstream myfile;
  myfile.open ("example.txt");
  myfile << "Writing this to a file.\n";
  myfile.close();
  return 0;
}
Posted by: Guest on November-09-2019
0

create and write to a file c++19

ofstream myfile;
myfile.open ("example.bin", ios::out | ios::app | ios::binary);
Posted by: Guest on March-21-2022

Code answers related to "create and write to a file c++19"

Browse Popular Code Answers by Language