#include <iostream> #include <fstream> int main() { std::ofstream file("test.txt"); if(file.is_open()) { file << "Text"; file.close(); } return 0; }