Sorry I forgot the limits.h thing. My point (perhaps I wasn't clear) was that you could do
Code:
if (matrix[i][j]==symbol_count[0])
symbol_count[0]++;
But that would get tedious to handle every single symbol (255 if/else statements). Instead, remove the if/else stuff and just put the following in the body of the loop
Code:
symbol_count[matrix[i][j]]++;
Note, you will need multiple sets of loops to check, and you will need to reset all the counts to zero between each row you check, and between each column you check.
If you've learned how to write your own functions, consider doing so. Some useful functions might be
Code:
bool reset_all_counts(int counts[], int num); // resets all num elements of counts[] to 0
bool check_row(int n, int matrix[n][n]) // it's important to put n first, and put it in the [] for matrix, since it's a VLA
// similar for check_col