title: C error assignment to expression with array type
body: <p>I have to write a code, which first reads a matrix from a file and then displays it. And it also has to sum the columns of matrix and find the biggest sum and display it. Compiler says on line 23 there's and error: assignment to expression with array type. How to fix it(beside all the other mistakes I have)?</p>
  
  <p>Thank you in advance.
  Here is my <a href="http://pastebin.com/fZPJAZhY" rel="nofollow noreferrer">code</a>.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define ROWS 15
  #define COLS 15
  
  int readMatrix(int r,int c, int Matrix[ROWS][COLS]);
  void printMatrix(int Matrix[ROWS][COLS], int r,int c);  
  int Sum(int Matrix[ROWS][COLS], int r,int c);
  void Congratulations(int Matrix[COLS], int c);
  
  int main(void)
  { 
      int Sales[ROWS][COLS];
      int Kokku[COLS];
      int rows, cols;
      int Matrix[ROWS][COLS];
  
      scanf("%d", &amp;rows); //loeb dokumendist ridade arvu
      scanf("%d", &amp;cols); //loeb dokumendist veergude arvu
  
      readMatrix(rows, cols, Matrix); //maatriksi sisselugemine
      printMatrix(Matrix, rows, cols); //maatriksi väljaprint
      Kokku = Sum(Sales, rows, cols); //müügitulemuste arvutus
      Congratulations(Kokku, cols); //Parima leidmine ja tunnustus
  
      return 0; 
  }
  int readMatrix(int r,int c, int Matrix[ROWS][COLS])
  {
      int i = 0, j = 0;
      int sellingTable;
      for(i = 0; i &lt; r; i++)
      {
          for(j = 0; j &lt; c; j++)
          {
              scanf("%d", &amp;Matrix[i][j]);
              sellingTable = i;
          }
      scanf("\n");
      }
      return sellingTable;
  }
  void printMatrix(int Matrix[ROWS][COLS], int r,int c)
  {
      int i, j;
      printf("Tabel:");
      j = 0;
      do
      {
          printf("M%2d", j + 1);
          j++;
      }
      while(j &lt;= c);
      for(i = 0; i &lt; r; i++)
      {
      printf("Kaup%2d", i + 1);
          for(j = 0; j &lt; c; j++)
          {
              printf("%4d", Matrix[i][j]);
          }
      printf("\n");
      }
  }
  int Sum(int Matrix[ROWS][COLS], int r,int c)
  {
      int i, j, sum;
      int Summa[c];
  
      printf("Kokku:");
  
      for(j = 0, sum = 0; j &lt; c; j++)
      {
          for(i = 0; i &lt; r; i++)
          {
              sum = Matrix[i][j] + sum;
              Summa[j] = sum;
          }
      printf("%4d", Summa[j]);
      }
      return sum;
  }
  void Congratulations(int Matrix[COLS], int c)
  {
      int j, temp;
      for(j = 0; j &lt; c; j++)
      {
          if(Matrix[j]&gt;Matrix[j + 1])
          {
              temp = Matrix[j];
              Matrix[j] = Matrix[j + 1];
              Matrix[j + 1] = temp;
          }
      }
      printf("Parim; nr %d, %d", c, Matrix[c]);
  }
  </code></pre>