E
Enlyth
Guest
Seyton, I have no time to make it into a GUI, but here is code that generates an "out.txt" file.
Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
string filename;
cout << "Enter file name: ";
getline(cin, filename);
ifstream ifile( filename.c_str() );
ofstream ofile( "out.txt" );
if ( ifile.is_open() == 0 || ofile.is_open() == 0 )
{
cout << "Cannot open file.";
return 0;
}
string line;
while ( getline( ifile, line ) )
{
if ( !line.size() || line.find_first_not_of(' ') == string::npos )
ofile << '`' << endl;
else
ofile << line << endl;
}
ofile.close();
ifile.close();
}










