Here's my problem with struct maybe someone can shed some light on it. I was working on comparing a sub string in a file to make sure it never repeated, each row/line was its own record and I was comparing the phone numbers some 258 chars out on the row. Prelude helped me with that and now it works!! But My problem now is to check the main file against a list of numbers that are in a different file.
Code:
#include "stdafx.h"
#include "iostream.h"
#include <cstring>
#include <fstream>
#include <functional>
#include <set>
#include <string>

using namespace std;

struct compare: binary_function<string, string, bool> {
  bool operator()(const string& a, const string& b)
  {
       return strncmp(a.c_str()+258 , b.c_str()+258 , 12)<0;
  }
};

void DupRemover(const char *filename, const char *nodup)
{
  ifstream in(filename);
  ofstream out(nodup);
  
  //ifstream dontcall("dnc.all");
  //string row;
  
  //set<string, compare> dnc_dup; 
  //while (getline(dontcall, row))
//	      dnc_dup.insert(row);
    string line; 
    set<string, compare> rem_dup;

while (getline(in, line,'\n'))	 
		rem_dup.insert(line);
	
	set<string, compare>::const_iterator it = rem_dup.begin();
	
  while (it != rem_dup.end())
  {
	  out<< *it <<endl;
	it++;
  }
}

int main (void)
{
        char filename[12];
	char nodup[12];
	cout<<"Enter your processed file: ";
	cin.getline (filename,11);
	strncat (filename, ".all", 6);
	cout << "Your File Name is " << filename << ".\n";
	cout<<"Enter the new file name: ";
	cin.getline(nodup,11);
	strncat (nodup, ".all",11);
	DupRemover(filename,nodup);
	return(0);
}
The code I commented out was my answer to the problem but I couldn't figure how to have it search the one list to the other. Any help would be great.
Sorry the post is so long.