title: Finding the max of a specified row and column in a 2D array C
body: <p>This is a function prototype to take in a 2D array, specific row, specific column, and size of the array (size is both the amount of rows and columns). It is then supposed to return the single max of the row and the column. I'm not quite sure what is happening but it is not behaving correctly and is just returning weird results. So I'm kind of lost, I feel like I'm close but not really sure what is going wrong.</p>
  
  <pre><code>int search_max(int a[][MAX], int r, int c, int size)
  {
   int maxr = a[0][0];
   int maxc = a[0][0];
   int maxfin = 0;
   int x;
   int y;
  
   for (x = r; x &lt;= r; x++)
   {
       for (y = 0; y &lt; size; y++)
       {
           if (maxr &lt; a[x][y])
           {
               maxr = a[x][y];
              return maxr;
           }
  
       }   
   }
  
   for (y = c; y &lt;= c; y++)
   {
       for (x = 0; x &lt; size; x++)
       {
           if (maxc &lt; a[x][y])
           {
               maxc = a[x][y];
               return maxc;
           }
       }
   }
  
   if (maxc &gt; maxr)
   {
       maxc = maxfin;
   }
  
   if (maxr &gt; maxc)
   {
  
       maxr = maxfin;
   }
  
   else
   {
       maxr = maxfin;
   }
  
   return maxfin;
  }
  </code></pre>