title: error: expression must have struct or union type in c
body: <p>I've been working on a code to store names and grades of students, then recall the grade when the students' names are entered.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define N 10
  #define M 2
  
  struct a
  {
       char name[50];
       int grade;
  };
  
  int main()
  {
      int i;
      int j;
      struct a A[N][M];
  
      for(i=0;i&lt;N;i++)
      {
           printf("Please Enter Students' Names:/n");
              scanf("%s", &amp;A[i].name);
      }
      for(j=0;j&lt;M;j++)
      {
          printf("Please Enter Students' Grades:/n");
              scanf("%d", &amp;A[j].grade);
      }
      printf("Which Student's Grades Would You Like To View?/n");
          if(scanf("%s", *A[i].name))
          {
              printf("Their Grade Is:%d/n", *A[j].grade);
          }
      return 0;
  }
  </code></pre>
  
  <p>I've been getting these errors:</p>
  
  <pre><code>hw2problem2.c(21): error: expression must have struct or union type
                          scanf("%s", &amp;A[i].name);
                                       ^
  hw2problem2.c(26): error: expression must have struct or union type
                          scanf("%d", &amp;A[j].grade);
                                       ^
  hw2problem2.c(29): error: expression must have struct or union type
                  if(scanf("%s", *A[i].name))
                                  ^
  hw2problem2.c(31): error: expression must have struct or union type
                          printf("Their Grade Is:%d/n", *A[j].grade);
                                                         ^
  compilation aborted for hw2problem2.c (code 2)
  </code></pre>
  
  <p>Any help with the errors or the program in general would be appreciated.
  Thanks.</p>