title: What is the purpose of having the forward declarations in the given fragment of C code?
body: <p>I have been assigned a task to maintain a legacy CGI program which adds data to a college database. This program is made up of a single file and is compiled without warnings. The file uses forward declarations as given below.</p>
  <pre><code>#define MAX_NAME_LEN 50
  
  enum Grade;
  enum Subject;
  struct Student;
  ...
  
  int lastErrorNo;
  
  void addGrade (enum Subject subj, enum Grade g, struct Student *stud);
  void editGrade (enum Subject subj, enum Grade g, struct Student *stud);
  ...
  
  enum Grade {
      A = 0,
      B,
      C,
      D,
      E
  };
  
  enum Subject {
      Calculus1 = 0,
      Calculus2,
      ...
      Mechanics
  };
  
  struct Student
  {
      char lastName[MAX_NAME_LEN];
      char firstName[MAX_NAME_LEN];
      ...
  };
  
  static int lastErrorNo = 0;
  
  int main(void) {
      ...
  }
  
  void addGrade (enum Subject subj, enum Grade g, struct Student *stud)
  {
      ...
  }
  
  void editGrade (enum Subject subj, enum Grade g, struct Student *stud)
  {
      ...
  }
  </code></pre>
  <p>I can't understand what is the purpose of the forward declarations of <code>Grade</code>, <code>Subject</code>, <code>Student</code> and <code>lastErrNo</code>? Why not to immediately replace them with their definitions?</p>