// using ofstream constructors. #include #include std::ofstream outfile ("test.txt"); outfile << "my text here!" << std::endl; outfile.close();