alright, well heres the problem... i have to read this data from a file...
Employee_No. Department Pay_Rate Exempt Hours_Worked Base_Pay
0101 41 8.11 Y 49
0722 32 7.22 N 40
1273 23 5.43 Y 39
2584 14 6.74 N 45
i need to create an employee register.. heres what i have so far.. the problem IS i cant figure out how to get the pay rate to read so that i can multiply it by the hours worked in order to calculate the base pay... I COULD use %s to read the pay rate, but you can't multiply an integer by a sequence... i feel like i've tried everything ALL day trying to figure out how to get the fscanf function to read my pay rate numbers... any help would be really appreciated.
int main (void)
char* titl1 ;
char* titl2 ;
char* titl3 ;
char* titl4 ;
char* titl5 ;
char* titl6 ;
char* num ;
int* exempt ;
printf("\t\tEmployee files and payroll register.\n\n");
spEmployeeData = fopen("EmployeeData.txt", "r");
printf("\t\tCould not open input file.\n");
}// if open file fails
fscanf(spEmployeeData, "%s%s%s%s%s%s", &titl1, &titl2, &titl3, &titl4, &titl5, &titl6);
printf("\t%s %s %s %s %s %s\n", titl1, titl2, titl3, titl4, titl5, titl6);
fscanf (spEmployeeData, "%s%d%.2f", &num, &deprt, &rate);
printf("%s %d %.2f", num, deprt, rate);//i need to continue with this pattern in order to read the rest of my data...
//i stopped here, because i can't get &rate to read properly!?