#include <fstream>
using namespace std;
int main( )
{
ofstream ofs("data.txt");
string buf;
if(ofs) {
ofs << "OK" << endl; // cout に書き出すのと同じ感じで
}
return 0;
}ネタ元
#include <fstream>
using namespace std;
int main( )
{
ofstream ofs("data.txt");
string buf;
if(ofs) {
ofs << "OK" << endl; // cout に書き出すのと同じ感じで
}
return 0;
}ネタ元