Sure. First, let's get rid of most of those includes:
Code:
//These are all you need
#include <iostream>
#include <fstream>
However, you'll need to use a few using directives (unless you want to go to each cout, cin, endl, etc. and put a std:: in front of them.
Code:
using std::ifstream;
using std::ofstream;
using std::cout;
using std::cin;
using std::endl;
using std::fstream;
using std::ios;
using std::cerr;
There are a few places where you can use a string instead of a char array. I'll show you an example of one. First, be sure to #include <string> and put a using std::string; in. Then look at this section of code:
Code:
int Annotate ( const char *inSource2)
/* Searches given file with user entered keycodes and appends
to the user given file with the extension of .all*/
{
ifstream fin;
ofstream fout;
char s2Line[lineSize]; // for data lines
// char filename [10]; //old code
string filename; //new code
By making that change, you'll have to change a couple of other lines. For instance, the getline right below it:
Code:
cout << "What's your File Name? ";
// cin.getline (filename,11); //old code
getline(cin,filename); //new code
The string concatenation is also different, but intuitive and easy:
Code:
// strncat (filename, ".all", 6); //old code
filename = filename + ".all"; //new code
After those three changes, it should compile again. I'll confess that I didn't try to run it, so there may be some logical errors, but that's the gist of it.