title: Min/max element of 2D array
body: <pre><code>float allmin[column];
  float allmax[column];
  float min= std::numeric_limits&lt;float&gt;::max();
  float max= std::numeric_limits&lt;float&gt;::min();  
  
  for(int y = 0; y &lt; column; y++)
     {
  
      for(int x = 0; x &lt; row; x++)
         {
           allmin[y] = std::min(matrix[x][y], min);
           allmax[y] = std::max(matrix[x][y], max);
         }
  
     cout &lt;&lt; "Mins " &lt;&lt; allmin[y] &lt;&lt; "\n";
  }
  </code></pre>
  
  <p>I need the smallest element of each column. My matrix is 250x6 , what it prints is the last row of the matrix.</p>