Answers for "c++ file text write"

C++
17

c++ files

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

fstream read write mode

stream file;
file.open(fileName,ios::in | ios::out);
Posted by: Guest on October-30-2020

Browse Popular Code Answers by Language