// DeEOF.cpp : Reads in a file and outputs the contents, omitting // all EOF characters. // // Parameter: - the file containing the undesired EOFs. // // // Written by Brendan Cunnie // #include "stdafx.h" #include #include #include #include #define ASCII_EOF 26 int main(int argc, char* argv[]) { bool fDisplayHelp = false; if (argc == 1) fDisplayHelp = true; if ( (argc>1) && ( (strcmp(argv[1],"-?")==0) || (strcmp(argv[1],"-h")==0)) ) { fDisplayHelp = true; } if (fDisplayHelp) { cout << "Takes a file and outputs it, stripping all EOF characters." << endl; cout << "Usage:" << endl; cout << " DeEOF " << endl; return (0); } ifstream ifile ( argv[1], ifstream::binary); char ch; for (ch = ifile.get(); !ifile.eof(); ch = ifile.get()) { if (ch != ASCII_EOF) { cout << ch << flush; } } return 0; }