Can any body help me with this simple thing in processing files?
Below is my code:
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ofstream savefile("anish.txt");
savefile<<"hi this is first program i writer" <<"\n this is an experiment";
savefile.close();
return 0 ;
}
Now it works successfully, I want to format the output of a text file in accordance with my method.
I have:
hi this is the first program i writer, this is an experiment
How to make the output file as follows:
hi is the first program
I write that this is an experiment
What should I do to format the output in this way?
source
share