#include <iostream>
#include <fstream>
int main()
{
std::ofstream afile;
afile.open("d:\\data.txt");
if (afile.is_open())
{
afile << "c++ programming language" << std::endl;
afile.close();
}
else std::cout << "Erroe open file";
return 0;
}
/*
run:
data.txt
--------
c++ programming language
*/