title: Adding rows and columns in a two dimensional array in C++
body: <p>I am able to add the elements of a row together in C++ and want to add all elements together in all rows and columns.  What I have written out adds the the values of rows together but prints out the columns seperately.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std
  int main() 
  {
  
  const int ROW = 10;
  const int COL = 20;
  
  int dimenArray[ROW][COL] ={{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 
  {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}};
  
  for (int i = 0; i &lt; ROW; i++) 
  {
      double totalArray = 0.0;
  
      for (int j = 0; j &lt; COL; j++)
          {
          totalArray += dimenArray[i][j];
          }
      cout &lt;&lt;"The total of dimenArray is " &lt;&lt; totalArray &lt;&lt; "." &lt;&lt; endl;
      }
  
  return 0;
  }
  </code></pre>
  
  <p>The output I get is.</p>
  
  <pre><code>The total of dimenArray is 55.
  The total of dimenArray is 210.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  The total of dimenArray is 0.
  </code></pre>
  
  <p>I would like to add the 55 and 210 together and produce one value.  Any tips are appreciated.</p>