title: Convert One Dimensional Arrary to Two Dimensional in C++
body: <p>I have a 49 space one dimensional array declared as <code>int boardArray [49];</code> and I also have a two dimensional 7x7 array declared as <code>int boardArrayTwo [7][7]'</code> I am trying to use nested for loops to throw the one dimensional array into the two dimensional array here is the code I am using to test it.</p>
  
  <pre><code>for (int i = 0; i &gt; 50; ++i)
  {
      boardArray[i] = i; //fills the array with ints 0 - 48 to test
  }
  for (int x = 0; x &gt;= 7; ++x)
  {
      for (int k = 0; k &gt;= 7; ++k)
      {
          for (int n = 0; n &gt;= 49; ++n)
          {
              boardArrayTwo[x][k] = boardArray[n];
              cout &lt;&lt; boardArrayTwo[x][k] &lt;&lt; " " &lt;&lt; endl;
          }
  
      }
  }
  </code></pre>
  
  <p>I tried running this but nothing happens. Am I doing it wrong?</p>