Search notes:

C++ Standard Library: ofstream, Writing a file

#include <fstream>

int main() {

  std::ofstream file;
  file.open("/tmp/fstream.txt");
  file << __FILE__ << std::endl;
  file.close();
}
Github repository about-cpp-standard-library, path: /fstream/ofstream_write-file.cpp

See also

C++ Standard Library

Index