The data in this program comes from a text file. It seems to read fine but when I try to print it only a portion of the data prints. I think I'm overlooking something but I can't put my eye on it.
I have this function reading the data.
Code:
void GetFile (int* EmployNum1, int* Dep1, float* PayRte1, char* Exempt1, int* Hours1, int* EmployNum2, int* Dep2, float* PayRte2, char* Exempt2, int* Hours2, int* EmployNum3, int* Dep3, float* PayRte3, char* Exempt3, int* Hours3, int* EmployNum4, int* Dep4, float* PayRte4, char* Exempt4, int* Hours4)
{
FILE* spData;
spData = fopen("C:\\employeefile.txt", "r");
if (spData == NULL)
{
printf("ERROR\n");
exit (101);
}
while ((fscanf(spData, "%4d%2d%4f%1c%2d%4d%2d%4f%1c%2d%4d%2d%4f%1c%2d%4d%2d%4f%1c%2d", EmployNum1, Dep1, PayRte1, Exempt1, Hours1, EmployNum2, Dep2, PayRte2, Exempt2, Hours2, EmployNum3, Dep3, PayRte3, Exempt3, Hours3, EmployNum4, Dep4, PayRte4, Exempt4, Hours4)) == 1);
While I have this printf statement in main printing.
Code:
printf("%4d %2d %4f %1c %2d", EmployNum1, Dep1, PayRte1, Exempt1, Hours1);
So what's the problem here?