programming-examples/c++/Others/Creates a file using fstream.cpp

14 lines
258 B
C++
Raw Normal View History

2019-11-15 12:59:38 +01:00
Creates a file using fstream
//this example creates a file called myfile.txt
//and adds some text message to it
#include <fstream.h>
int main()
{
ofstream MyFile("myfile.txt");
MyFile<<"This is some test message";
MyFile.close();
return 0;
}