Answers for "how to create a file and write in c++"

C++
1

create file c++

// using ofstream constructors.
#include <iostream>
#include <fstream>  

std::ofstream outfile ("test.txt");

outfile << "my text here!" << std::endl;

outfile.close();
Posted by: Guest on January-01-2021
0

write to file in C++

ofstream myfile;
myfile.open("file.txt");

myfile << "write this to file"
Posted by: Guest on July-01-2020

Code answers related to "how to create a file and write in c++"

Browse Popular Code Answers by Language