Max Line Size and Structs
Heres what I'm trying to do
for each item in N file:
for each item in M file:
see if this N list item is the same as this M list item
Now to do this I'm using this code and have a few problems :
Code:
void DupRemover( const string& dontcall)
{
ifstream in("tested.all");
ofstream trial("newfile.all");
ifstream dnc("dnc.all");
ofstream nodup( "dup.all");
string line;
string number;
set<string, compare> strSet;
while (getline(in, line))
{
strSet.insert(line);/*When I put this in the file trial>>"newfile.all" it shortens the line to 64-65 characters which screws up my code from then on. The line size is 501 characters per row/*
}
set<string, compare>::iterator tic;
copy(strSet.begin(),strSet.end(),ostream_iterator<string>(trial,"/n"));
while (getline(dnc,number,'\n'))//;tic != strSet.end())
{
tic = find_if(strSet.begin(),strSet.end(),Search(number));
if( tic != strSet.end() )
{
trial<<*tic <<endl;
strSet.erase(tic);
}
}
copy(strSet.begin(),strSet.end(),ostream_iterator<string>(nodup,"\n"));
}
Do you have any ideas, the program doesn't really out put anything and it seems to hang in spots. Is the strSet.erase actually erasing the data at position tic when the data matches up?
Thanks again for all your future and past help.