This program is suppose to read in two files and print 2 reports, sorted and unsorted.
All it does is print the headings for the sorted.
Here is the part that I suspect is wrong:
Code:
include "customer.h"
contains:
#define CUSTOMER_ID 10
#define FIRST_NAME 11
#define MIDDLE_NAME 11
#define LAST_NAME 11
#define ADDRESS_SIZE 26
#define CITY_STATE_ZIP_SIZE 26
#define PHONENO_SIZE 16
#define EMAIL_ADDRESS 26
#define LABOR_COST .35f
#define TAX_AMT .085f
#define PAGE_LIMIT 6
#define SUMMARY_LIMIT 2
#define LIMIT_SIZE 1000
and
include "order.h" contains:
#define ORDER_ID 10
The part that I think is wrong:
int initialization(struct CUST_INFO custRecs[LIMIT_SIZE], int *pageNo, FILE * custFilePtr, struct ORDER_INFO orderRecs[LIMIT_SIZE], FILE * orderFilePtr, FILE * processFilePtr)
{
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\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);
}//end while loop
while (( k < LIMIT_SIZE) && (fgets(inputBuffer, 1024,
orderFilePtr) != NULL))
{
sscanf(inputBuffer, "%9c %25c %i %i %i %f\n",
orderRecs[k].orderId, &orderRecs[k].width,
&orderRecs[k].length,
&orderRecs[k].carpetCharge, &orderRecs[k].discount);
k++;
}//end while loop
GetTopLine(processFilePtr);
PrintHeadings(pageNo, processFilePtr);
return k;
}//end initialization