void writePartsToFile( char *fileName, int partId[MAX_PARTS], int partQ[MAX_PARTS], int n)
{
int i;
FILE *filePtr;
filePtr = fopen(fileName, "w");
if( filePtr == NULL)
{
printf("Unable to open the data file to write\n");
return; //bail out
}
fclose(filePtr);
}
void printParts(const int id[MAX_PARTS],const int quantity[MAX_PARTS], int n)
{
int i;
printf("ID\tQuantity\n");
printf("----\t----\n");
for(i = 0; i < n; ++i){
printf("%d\t%d\n", id[i], quantity[i]);
}
}
int findPartID(int partNum, const int id[], int n)
{
int loc = -1;
int i;
for(i = 0; i < n; ++i){
if(partNum == id[i]){
loc = i;
break;
}
}