Printing an array.

Apr 30, 2013 at 12:48am
I just want to know if I am doing this code correctly because when it outputs, it shows the numbers that I've entered but it only display one name for all.
1
2
3
4
5
6
7
const int MAXEMPS = 5;
for (int Index = 0;Index<MAXEMPS;Index++)
{
 printf(REPFORMTa,fullname,theEmps[Index].payrate,theEmps[Index].hours,theEmps[Index].gross,theEmps[Index].fedtax,theEmps[Index].ssitax,theEmps[Index].net);
 printf(REPFORMTb,theEmps[Index].ovthours,theEmps[Index].statetax, theEmps[Index].defr);
 printf("\n");
}
Apr 30, 2013 at 3:25am
u doing this in C..omg it's really complicated
Apr 30, 2013 at 3:29am
Well, from the looks of it, you print fullname without regards to the value of index.
Apr 30, 2013 at 4:32am
Thank you, that fixed my problem.
Topic archived. No new replies allowed.