Skip to content

Latest commit

 

History

History
37 lines (20 loc) · 1.1 KB

File metadata and controls

37 lines (20 loc) · 1.1 KB

 

 

 

 

 

 

std::fstream is an STL stream for file I/O.

 


#include <fstream> int main() {   {     //Create a new file (or remove its contents)     std::ofstream f;     f.open("my_file.txt");     f << "Hello";   }   {     //Append to file     std::ofstream f;     f.open("my_file.txt",std::ios::app);     f << " world\n";   } }