I need help with my code. I need to find the smallest and largest of each row of a two dimensional array, coming from a structure....
the structure has 3 different skaters and each one has a two dimensional array as follows
(example is just of one skater)
here is the array
0 2 1 1 1 0 1 0 1 1 1 1
1 2 2 2 2 1 2 1 2 2 2 2
2 1 1 1 1 0 0 2 1 2 1 2
2 1 1 1 1 1 2 1 1 1 1 1
2 2 2 2 1 2 3 3 2 3 2 1
1 1 1 2 2 0 0 0 1 2 1 1
1 0 2 2 1 1 1 2 2 2 2 1
1 1 2 2 1 1 1 1 2 2 1 1
the structure is skater[x].scores[][];
Code:{ int i = 0; int smallest[7]; int f; int j; int a; while ( i < count) { for ( j = 0; j < 8; j++) { for ( a = 0; a<12; a++) { smallest[j] = skater[i].scores[j][a]; if( smallest[j]< skater[i].scores[j][a+1] ); smallest[j] = skater[i].scores[j][a+1]; } printf ( "%d\n", smallest[j]); } printf( "\n\n"); i++; }