The prototype
void Print_Sorted_Employee_Detail_To_File(FILE *report, int i, int i2, int index,
char full_name, float pay_rate, float hours, float ovt_hours,
float gross, float federal_tax, float state_tax, float ssi_tax,
float deferred, float net_pay);
The call:
Print_Sorted_Employee_Detail_To_File(report, i, i2, index[i], full_name[i],
pay_rate[i], hours[i], ovt_hours[i], gross[i], federal_tax[i],
state_tax[i], ssi_tax[i], deferred[i], net_pay[i]);
This is the function definition, I'm sure there is something with the parameter passing here but compiler gives me 10 errors: subscript requires array or pointer type.
void Print_Sorted_Employee_Detail_To_File(FILE *report, int i, int i2, int index,
char full_name, float pay_rate, float hours, float ovt_hours,
float gross, float federal_tax, float state_tax, float ssi_tax,
float deferred, float net_pay)
{
fprintf(report, "%55s\n\n\n", "In alphabetical order");
for (i2 = 0; i2 < i; i2++)
{
fprintf(report, " %-15.15s%6.2f%9.2f%9.2f%9.2f",
full_name[index[i2]],pay_rate[index[i2]],hours[index[i2]],
gross[index[i2]],federal_tax[index[i2]]);
fprintf(report, "%8.2f%9.2f \n%40.2f%18.2f%8.2f \n\n\n",
ssi_tax[index[i2]],net_pay[index[i2]],ovt_hours[index[i2]],
state_tax[index[i2]],deferred[index[i2]]);
}
}
before I moved it from main, it worked no problem. My brain must be sleeping cuz I can't figure out what's wrong.