C++ Text File Write String by String

Description

C++ Text File Write String by String

#include <fstream>
using namespace std;
int main()//from   w  w  w  . j a  v  a  2 s  . c  o  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;
}



PreviousNext

Related