I believe That there is an error in this function. The program is to act as a upc scanner, it has 2 hard coded arrays 1 for upc codes and 1 for prices. it also has 2 more nonhardcoded arrays, when you enter the upc codes this function is supposed to take in the upc codes check them and put the corrrect vales in the upchold and pricehold arrays , but it isn't. any help would be appreciated.
Thanks
Steve
<code>
----------------------------------------------------------------------------------- int newsale ( int UPC [], float PriceHold [], float Price [], int UPCHold [])
{
int s, foundSw, count=0, UPCnum, ItemNum=0, x=0;
cout<<"Please enter your UPC Codes"<<endl;
while ( 1 )
{
cin >> UPCnum;
if ( UPCnum == 999 )
break;
foundSw=0;
for ( s=0; s<25; s++ )
{
if ( UPCnum == UPC[s] )
{
foundSw=1;
break;
}
}
if (foundSw ==1)
{
UPCHold [x] = UPC[s];
PriceHold [x] = Price[s];
x++;
}
else
cout << "INVALID UPC CODE"<<endl;
}
return x;
}
----------------------------------------------------------------------------------
\code