Yes, you can.
Check out the output file stream.
#include <fstream> int main() { std::ofstream file("MyFile.txt", std::ofstream::out); file << "Hello World!"; file.close(); return 0; }