Code:
fscanf(ifp, "%d", &num_couples);
for(i=0; i<num_couples; i++)
{
for(j=0; j<num_couples; j++)
{
fscanf(ifp, "%s", man_name[j]);
fscanf(ifp, "%s", woman_name[j]);
fscanf(ifp, "%d", &men_ratings[i][j]);
fscanf(ifp, "%d", &women_ratings[i][j]);
}
}
Below is what I put for my declarations because the male and female names are supposed to be strings of at most 19 characters and the max number of couples is 10. Also the men and the women will rate each other from 1-10. idk if that is enough info. It's a matching and permutation problem, but does the scanning and dimensions look right at all? I don't know if everything should be a 2d array.
int men_ratings[10][10], women_ratings[10][10];
char man_name[20], woman_name[20];