title: Indexing a single dimensional array with a double for loop
body: <p>This should be something simple to do and I should know this, but I'm at a blank.</p>
  
  <pre><code>struct Coords {
      unsigned row;
      unsigned col;
  };
  
  Coords indexTable[256];
  
  for ( unsigned row = 0; row &lt; 16; ++row ) {
      for ( unsigned col = 0; col &lt; 16; ++col ) {
          unsigned currIndex = ?
          indexTable[currIndex].row = something;
          indexTable[currIndex].col = something;
      }
  }
  </code></pre>
  
  <p>What is the calculation for the current index? currIndex would be the same as traversing through [0,255] in a single for loop.</p>