im trying to get this function to show the numbers that are not on the list in the input file, i've written this and it doesnt work, i know theres sometihng wrong with it but im not sure what it is? or how i can fix it to make it work or be more efficient
void not_part()
{
ins.open(in_file);
int i=0;
int t=0;
int j=0;
int sum=0;
cout<<"AGENTS WHO DID NOT PARTICIPATE IN THE CAMPAIGN"<<endl;
cout<<fixed<<showpoint;
cout<<setprecision(2);
while(!ins.eof())
{
int agnt, sals;
float val;
ins>>agnt>>sals>>val;
int row = FindAgent(agnt,i);
if( row < 0)
{
agent[i]=agnt;
sales[i]=sals;
value[i]=val;
amount[i]=sales[i]*value[i];
i++;
}
else
{
sales[row]+=sals;
sum=sals*val;
amount[row]+=sum;
value[row]=amount[row]/sales[row];
}
}
for(int t=0; t<=count; t++)
for(int h=1; h<=20; h++)
{
if((agent[t]!=h)||((value[t]=0)&&(amount[t]=0)))
cout<<setw(2)<<agent[t]<<endl;
}
cout<<endl;
ins.clear();
ins.close();
}
int FindAgent(int agnt, int maxrow)
{
for(int i = 0; i < maxrow; i++)
if( agent[i] == agnt)
return i;
return -1;
}