title: Expression must have a pointer to object type in C
body: <p>I am trying to use pointers in functions and arrays and when I call the report function in main, I keep getting an error Expression must have a pointer to object type. I have tried everything. Nothing seem to be working. Can anyone please let me know what I am doing wrong?</p>
  
  <p>Please note: without the <code>report</code> function, if I call the other functions separately in <code>main</code> it works. It's not working only with the <code>report</code> function.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  void print(int *list, int row_count, int column_count);
  void rowaverage(int *list, int row_count, int column_count);
  void allaverage(int *list, int row_count, int column_count);
  void largest(int *list, int row_count, int column_count);
  void report(int *list, int row_count, int column_count);
  
  int main()
  {
    int i = 1, row, column;
    int list[3][5];
    printf("Enter 3 sets of 5 integers::\n");
    for (row = 0; row &lt; 3; row++)
    {
      printf("Elements in the %d set are ::\n", row);
      for (column = 0; column &lt; 5; column++)
      {
        printf("Element No. %d is ", i++);
        scanf("%d", &amp;list[row][column]);
      }
      printf("\n");
      i = 1;
    }
    printf("The elements in array are:\n");
  
    report(&amp;list[0][0], row, column);
  
    getch();
    return 0;
  }
  
  void print(int *list, int row_count, int column_count)
  {
    int column, row;
    for (row = 0; row &lt; row_count; row++)
    {
      for (column = 0; column &lt; column_count; column++)
      {
        printf("%8d", *(list + row * column_count + column));
      }
      printf("\n");
    }
  }
  
  void rowaverage(int *list, int row_count, int column_count)
  {
    int column, row;
    for (row = 0; row &lt; row_count; row++)
    {
      float sum = 0, count = 0;
      for (column = 0; column &lt; column_count; column++)
      {
        sum += *(list + row * column_count + column);
        count++;
      }
      printf("Average of row %d is %.2f\n", row, (sum / count));
    }
  }
  
  void allaverage(int *list, int row_count, int column_count)
  {
    int column, row;
    float sum = 0, count = 0;
    for (row = 0; row &lt; row_count; row++)
    {
      for (column = 0; column &lt; column_count; column++)
      {
        sum += *(list + row * column_count + column);
        count++;
      }
    }
    printf("Average of all elements in array is %.2f\n", (sum / count));
  }
  
  void largest(int *list, int row_count, int column_count)
  {
    int column = 0, row = 0;
    int largest = *(list + row * column_count + column);
    for (row = 0; row &lt; row_count; row++)
    {
      for (column = 0; column &lt; column_count; column++)
      {
        if (largest &lt; *(list + row * column_count + column))
        {
          largest = *(list + row * column_count + column);
        }
      }
    }
    printf("The largest number in the array is %d\n", largest);
  }
  
  void report(int *list, int row_count, int column_count)
  {
    int row = 0, column = 0;
    print(list[0][0], row, column);
    printf("\n");
    rowaverage(list[0][0], row, column);
    printf("\n");
    allaverage(list[0][0], row, column);
    printf("\n");
    largest(list[0][0], row, column);
  }
  </code></pre>