void Students_Absence_Report()
{
int i;
double presence[NO_OF_STUDS], absence[NO_OF_STUDS];
for(i=0; i<NO_OF_STUDS; i++)
{
presence[i] = ((double)student[i].presentDays/14)*100;
absence[i] = 100 - presence[i];
}
printf("\n\nStudents Presence/Absence Report\n");
printf("--------------------------------\n");
printf(" Name\t\t%%Presence\t%%Absence\n");
for(i=0; i<NO_OF_STUDS; i++)
{
printf("%-3d %-19s %.2f\t\t%.2f\n", student[i].studNo, strcat(student[i].surname, student[i].givenName), presence[i], absence[i]);
}
printf("\n******** END OF ATTENDANCE REPORT ********\n");
}
Anythings wrong in this function? everytime i do loopinh, the strcat will generate larger and larger name...anywhr to solve tis??