# Thread: 2D Arrays Homework Help

1. ## 2D Arrays Homework Help

Hello, I have most of the code working properly, but I'm having trouble with a certain area. Currently I have multiple 2D arrays. One is a char array and the other is an int array. In the int array I have to find the max number in each column, which I've done. The problem is, I need to print the max number's row in relation to the char array's row.

For example,
Code:
```int array[2][3] =
{60 50 30
0 100 1}

The max numbers are 60, 100, 30.

char array[2][length+1] =
{nameOne
nameTwo}

How it needs to print:
nameOne has max score of 60.
nameTwo has max score of 100.
nameOne has max score of 30.```
I just can't understand how to compare the two arrays in the right way, so it'll know that nameOne is associated with the numbers in row 0 and nameTwo in row 1, etc. I hope this makes sense, if anyone can point me in the right direction, that would be great! Thanks

2. When on i-th column at the int array, you need to reference the i-th row from the char array. When the i-th row from the char array reaches the 1st dimension of the char array (that is in your example 2), reinitialize i for the char array to zero.