C++ examples for File Stream:stream
Save string to file
#include <fstream> using namespace std; int main()/*from ww w . j a v a 2 s . co m*/ { ofstream outfile("TEST.TXT"); //create file for output outfile << "this is a test!\n"; outfile << "another line\n"; outfile << "word word word,\n"; outfile << "test test test.\n"; return 0; }