I knew that. Slap self up side the head. I made those changes
and it still doesn't work.
Here it is again with the changes.
also here is the definition and the calling function:
Code:
int initialization(struct CUST_INFO custRecs[LIMIT_SIZE], *pageNo, FILE * custFilePtr, struct ORDER_INFO orderRecs[LIMIT_SIZE], FILE * orderFilePtr, FILE * processFilePtr,
int *pageNo,
int *pageNo);
Code:
howMany = initialization(custRecs, processFilePtr, orderRecs, orderFilePtr, processFilePtr, &pageNo);
Code:
initialization(struct CUST_INFO custRecs[LIMIT_SIZE],
FILE * custFilePtr, struct ORDER_INFO orderRecs[LIMIT_SIZE],
FILE * orderFilePtr, FILE * processFilePtr, int *pageNo)
{
int k = 0;
char inputBuffer[1024] = {0};
while ((k < LIMIT_SIZE) && (fgets(inputBuffer, 1024,
custFilePtr)!= NULL))
{
sscanf(inputBuffer, "%9c %10c %10c %10c %25c %25c %15c %25c\n",
&custRecs[k].CustomerId, &custRecs[k].CustomerFirstName,
&custRecs[k].CustomerMiddleName, &custRecs[k].CustomerLastName,
&custRecs[k].CustomerAddress, &custRecs[k].CityStateZip,
&custRecs[k].CustomerPhoneNo, &custRecs[k].CustomerEmailAddress);
}
while ((k < LIMIT_SIZE) && (fgets(inputBuffer, 1024,
orderFilePtr)!= NULL))
{
sscanf(inputBuffer, "%9c %i %i %i %f\n",
&orderRecs[k].orderId, &orderRecs[k].width, &orderRecs[k].length,
&orderRecs[k].carpetCharge,
&orderRecs[k].discount);
printf("Read All Records");
k = 1;
k++;
}//end while loop
GetTopLine(processFilePtr);
PrintHeadings(pageNo, processFilePtr);
return k;
}//end initialization