+ 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 Answers
+ 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