title: Expected expression before ‘)’ token and variable undeclared errors
body: <p>This is the program i'm trying to write:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;malloc.h&gt;
  struct student {
      char name[20];
      float point;
  };
  void inputlst (struct student *sv, int n){
      int i;
      for(i = 0; i &lt; n; i++){
          puts("Name: "); gets((sv+i)-&gt;name);
          puts("Point: "); scanf("%f", &amp;(sv+i)-&gt;point);
      }
  }
  void outputlst (struct student *sv, int n){
      int i;
      for(i = 0; i &lt; n; i++){
          puts((sv+i)-&gt;name); printf("%f", (sv+i)-&gt;point);
      }
  }
  void main(){
      struct student *classA;
      int n;
      printf("No. of students: ");
      scanf("%d", &amp;n);
      classA = (student*)malloc(n*sizeof(student));
      if(classA == NULL)
          puts("Could not provide dynamic memory");
      else{
          inputlst(classA, n);
          outputlst(classA, n);
      }
  }
  </code></pre>
  
  <p>When i ran it, i encountered these errors:</p>
  
  <pre><code>1/error: ‘student’ undeclared (first use in this function)
  classA = (student*)malloc(n*sizeof(student));
            ^~~~~~~
  2/error: expected expression before ‘)’ token
  classA = (student*)malloc(n*sizeof(student));
                    ^
  </code></pre>
  
  <p>What does it mean by: "‘student’ undeclared" when i already declared it in the void() function and what expression am i expected to put into my function at the specified place?</p>