for some odd reason the damn thing wont sum the list[index].hours_in_week before it goes onto the next if statement any help would be greatCode:int readfile(FILE *ifp, struct employee list[]){ //define ints char LastName[MAX_LEN]; char FirstName[MAX_LEN]; int clockinhr = 0, clockinmin = 0, clockouthr = 0, clockoutmin = 0, weekEntries = 0; int j, k, l, index; int num = 0, dataset; // read in the number of employees fscanf(ifp, "%d", &num); // Loops to the amount of employees for (index=0 ; index < num; index++) { //This reads in the first and last name and there pay per hour fscanf(ifp, "%s", list[index].first); fscanf(ifp, "%s", list[index].last); fscanf(ifp, "%lf", &list[index].payperhr); } //Reads in the data set fscanf(ifp, "%d", &dataset); // This will loop through the data set for (j = 0; j < dataset; j++){ //Reads in each week fscanf(ifp, "%d", &weekEntries); for (k = 0; k < weekEntries; k++){ //This will take in the employees first and last name and the time they clocked in and out fscanf(ifp, "%s %s %d %d %d %d", LastName, FirstName, &clockinhr, &clockinmin, &clockouthr, &clockoutmin); //Runs through each employee for (index =0; index < num; index++){ //if (( strcmp(LastName, list[index].last) == 0 ) && ( strcmp(FirstName, list[index].first) == 0 ) ){ //calculates total hours for the week list[index].hours_in_week += ((clockouthr - clockinhr) + ((clockoutmin - clockinmin)/60.00)); // } printf(" %lf ", list[index].hours_in_week); //This will take care of over time if (list[index].hours_in_week > 40){ //Calculates amount of overtime list[index].gross += (1.50*list[index].payperhr)*(list[index].hours_in_week - 40.00) + (list[index].payperhr * 40); //Calculates taxes on the overtime list[index].taxes += (.20 * ((1.50 * list[index].payperhr) * (list[index].hours_in_week - 40.00))) + (.10 * 40); } list[index].gross += list[index].payperhr * list[index].hours_in_week; list[index].taxes += 0.10 * list[index].payperhr * list[index].hours_in_week; //resets the hours back to zero list[index].hours_in_week = 0; } } } return num; }