Horje
create and write to a file c++19 Code Example
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;
}
create and write to a file c++19
ofstream myfile;
myfile.open ("example.bin", ios::out | ios::app | ios::binary);




8

Related
file objects in c++ Code Example file objects in c++ Code Example
how to do file handling in c++ Code Example how to do file handling in c++ Code Example
convert string to char c++ Code Example convert string to char c++ Code Example
removing a character from a string in c++ Code Example removing a character from a string in c++ Code Example
range of long long in c++ Code Example range of long long in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13