The following lines of code from a function of mine is producing the output (this is just for a couple of the error lines but its all like this):
hours_3b.c:151: error: invalid operands to binary + (have ‘float *’ and ‘float’)
hours_3b.c:153: error: invalid operands to binary + (have ‘float *’ and ‘double’)
Here is the code for the function:
Code:
if (employeeData[i].hours > STD_HOURS) {
total_grossOT += employeeData[i].gross;
/*Calculates sum total of gross pay */
total_OT += (employeeData[i].hours - STD_HOURS);
/*Calculates sum total of OT */
total_hours += (employeeData[i].hours + employeeData[i].OT);
/*Calculates sum total of hours */
}
else {
employeeData[i].OT = 0;
total_gross += (employeeData[i].wage_rate * employeeData[i].hours);
/*Calculates the sum total of gross pay */
total_hours += employeeData[i].hours;
/*Calculates sum total of hours */
}
Im trying to figure out why this is happening. All of the variables being used are of type float.