Thiis is the printing code, with the aligned output. Should give you some idea's:
Code:
printf("\n\nName Sex ID Ratings\n");
printf("====================================");
for(i=0;i<count;i++) {
printf("\n%-19s %c %2d ", names[i].name, names[i].sex, names[i].id);
for(j=0;ratings[i][j]>0;j++) {
printf(" %d", ratings[i][j]);
}
}
fclose(fp);
free(names);
printf("\n\n\t\t\t press enter when ready");
i=getchar();
return 0;
}
//Output:
groups: 2 each: 3
Name Sex ID Ratings
====================================
Adam M 1 4 8 7
Bob M 2 6 7 5
Carl M 3 5 9 6
Diana F 4 7 6 8
Ellen F 5 6 5 9
Fran F 6 4 7 3
press enter when ready