title: How to access elements of a Matrix using loops
body: <p>I have two 4x4 multidimensional arrays, and the rows and columns are marked as being <code>A</code>, <code>B</code>, <code>C</code> and <code>D</code>. When the user inputs the co-ordinates, the value of known_location_info selected is changed to the value of bomb_location_info. So for example, if <code>AA</code> was input then the value of <code>[1][1]</code> on <code>known_location_info</code> is changed to the value of <code>[1][1]</code> on <code>bomb_location_info</code>. At the moment I am only getting the first element to change regardless of what co-ordinates are entered. What is incorrect in my loop?</p>
  
  <pre class="lang-c prettyprint-override"><code>char inputRow;
  char inputColumn;
  char letterA = 'A';
  
  void display(int known_location_info[][DIM], int size) {
  
      printf("  A  B  C  D\n");
  
      for (int row = 0; row &lt; DIM; row++) {
  
          printf("%c", letterA);
          letterA++;
  
          for (int column = 0; column &lt; DIM; column++) {
              printf("%d ", known_location_info[row][column]);
          }
          printf("\n");
      }
  
      printf("Please select a row and column: ");
      scanf("%c, %c", &amp;inputRow, &amp;inputColumn);
  }
  
  void update_known_info(int row, int col, int bomb_location_info[][DIM], 
                         int known_location_info[][DIM]) {
  
      for (inputRow = letterA; inputRow &lt; DIM; inputRow++) {
          for (inputColumn = letterA; inputColumn &lt; DIM; inputColumn++) {
              row++;
              col++;
          }
      }
  
      known_location_info[row][col] = bomb_location_info[row][col];
  }
  </code></pre>