Can you tell me how to pass a string to a file .txt? Thanks. | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 9

Can you tell me how to pass a string to a file .txt? Thanks.

7th Jun 2017, 3:59 PM
Umbe
Umbe - avatar
5 ответов
+ 6
#include <fstream> int main (){ ofstream ofile ("test.txt") ofile << "Hello world\n"; ofile << "Writing in the file"; ofile.close (); }
7th Jun 2017, 4:03 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 8
oh thank you very much
8th Jun 2017, 12:01 AM
Umbe
Umbe - avatar
+ 5
What do you mean @Tobias?
26th Jun 2017, 6:20 PM
Umbe
Umbe - avatar
+ 3
Welcome
8th Jun 2017, 2:51 AM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
- 1
You do the right thing and then u et the answer right but if I do the wrong thing, u get the answer wrong
26th Jun 2017, 11:57 AM
Tobias Teichman
Tobias Teichman - avatar