From 53b2658a81211fd5e2e3b9ed4a87893900b02c44 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 8 Dec 2024 16:00:30 +0300 Subject: [PATCH] c++ write file --- code/C++/write_to_file.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 code/C++/write_to_file.cpp diff --git a/code/C++/write_to_file.cpp b/code/C++/write_to_file.cpp new file mode 100644 index 0000000..6b0c83e --- /dev/null +++ b/code/C++/write_to_file.cpp @@ -0,0 +1,10 @@ +#include +using namespace std; + +int main() { + ofstream myfile; + myfile.open("example.txt", ios::in | ios::app); + myfile << "Сообщение\n"; + myfile.close(); + return 0; +}