title: error C2296: '*' : illegal, left operand has type 'int *'
body: <p>I am trying to make a function that multiplies 2 matrices into a new one , its almost finished but I am having had a hard time trying to figure out whats wrong with this line </p>
  
  <p>Here's the Code: </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  #define ROWS_1  3
  #define ROWS_2  3
  #define COLS_1  3
  #define COLS_2  2
  
  
  int* matrixMultiply(int mat1[ROWS_1][COLS_1],int mat2[ROWS_2][COLS_2])
  {
      int mul = (ROWS_1)*(COLS_2);
      int* ArrofRows;
      int sum=0,i,j,k;
      ***ArrofRows = (int*)malloc(mul)*sizeof(int);***
      if (COLS_1 != ROWS_2)
      {
          printf("ERROR!! Operation Failed!Exiting...\n");
          exit(0);
      }
      else
      {
          for( i=0 ; i&lt;ROWS_1 ; i++)
          {
              for( j=0 ; j&lt;COLS_2 ; j++)
              {
                  for( k=0 ; k&lt;COLS_1 ; k++)
                  {
                      sum += (mat1[i][k]*mat2[k][j]);
                  }
                  ArrofRows[(i*ROWS_1)+j] = sum;
                  sum = 0;
              }
          }
      }
  }
  
  void main()
  {
      int mat1[ROWS_1][COLS_1] = {{2,6,9},{3,5,4},{6,7,8}};
      int mat2[ROWS_2][COLS_2] = {{2,4},{6,1},{4,8}};
      int* NewMat;
      NewMat = matrixMultiply(mat1,mat2);
  }
  </code></pre>