Answers for "c++ reading and writing a file"

C++
33

c++ writing to file

// 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

Code answers related to "c++ reading and writing a file"

Browse Popular Code Answers by Language