title: Fortran array Index
body: <p>I am migrating the Fortran code to C. I would like to know what will be the C equivalent for the following statements
  T is a 2d array of dimension <code>(B,B)</code> and <code>T_indices</code> is an array of indices in <code>T</code> , <code>T_indices(E)</code> where <code>E &lt; B</code>. <code>Ai</code> and <code>Bi</code> are variables.</p>
  
  <pre><code>T(T_indices(:),:) = 1/(Ai/Bi)*T(T_indices(:),:)
  
  T(:,T_indices(:)) = 1/(Ai/Bi)*T(:,T_indices(:))  
  </code></pre>
  
  <p>My proposed C translation:</p>
  
  <pre><code>for (i=0 ; i &lt; E ; i++){
   for (j=0 ; j&lt; B ; j++){
    T[(T_indices[i]-1) * B + j] = 1/(Ai/Bi)* T[(T_indices[i]-1) * B + j];
    T[j * B + (T_indices[i]-1)] = 1/(Ai/Bi)* T[j * B + (T_indices[i]-1)];
   }
  }
  </code></pre>
  
  <p>Is this a correct translation?</p>