title: How clear the screen and return to menu
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  struct student
  {
      string firstname;
      string lastname;
      int age;
      string gender;
      string course;
      string year;
      string section;
      int studno;
  };
  
  int menu(int &amp;menuChoice);
  void userInfo(student user[], int size, int const track);
  void listUser(student user[], int size, int const track);
  
  int main(int argc, char** argv) {
  
  int menuChoice;
  int static track = 0;
  
  student user[30];
  
  do {
      menu(menuChoice);
  
     switch(menuChoice) {
        case 3:
            userInfo(user, 30, track);
            track++;
            break;
        case 4:
            listUser(user, 30, track);
            break;
      }
  } while(menuChoice != 5);
  
    return 0;
  </code></pre>
  
  <p>}</p>
  
  <pre><code>    int menu(int &amp;menuChoice)
      {
  
          do {
              cout&lt;&lt; "\n\t\t==========================================="
               &lt;&lt; "\n\t\t|\tSimple Student Record Program\t  |"
               &lt;&lt; "\n\t\t==========================================="
               &lt;&lt; "\n\n\t\t\t\t [MAIN MENU]"
               &lt;&lt; "\n\n\n[1] - Search Student\n[2] - Best Students\n[3] - Add New Student\n[4] - View Students\n[5] - Delete Student"
               &lt;&lt; "\n\nEnter a choice: ";
  
          cin&gt;&gt; menuChoice;
  
          if (menuChoice&gt;5||menuChoice&lt;1)
              {
               cout&lt;&lt; "Please select an existing option!";
               }
      } 
  
      while (menuChoice&gt;5||menuChoice&lt;1);
  
      return menuChoice;
  }
  
  void userInfo(student user[], int size, int const track)
  {
      cout&lt;&lt; "\n\n\t\t\t\t[Add a student]";
      cout&lt;&lt; "\n\nEnter student's first name: ";
      cin&gt;&gt; user[track].firstname;
      cout&lt;&lt; "\nEnter student's last name: ";
      cin&gt;&gt; user[track].lastname;
      cout&lt;&lt; "\nAge: ";
      cin&gt;&gt; user[track].age;
      cout&lt;&lt; "\nGender: ";
      cin&gt;&gt; user[track].gender;
      cout&lt;&lt; "\nCourse: ";
      cin&gt;&gt; user[track].course;
      cout&lt;&lt; "\nYear: ";
      cin&gt;&gt; user[track].year;
      cout&lt;&lt; "\nSection: ";
      cin&gt;&gt; user[track].section;
      cout&lt;&lt; "\nStudent No.: ";
      cin&gt;&gt; user[track].studno;
      return;
  }
  
  void listUser(student user[], int size, int const track)
  {
      int list;
      cout&lt;&lt; "\n\tName|||Age|||Gender|||Course|||Year|||Section|||Student No.\n";
      for (list=0; list&lt;track; list++)
      {
          cout&lt;&lt; "\n\n" &lt;&lt; user[list].firstname &lt;&lt;" " &lt;&lt; user[list].lastname &lt;&lt;"\t\t" &lt;&lt; user[list].age &lt;&lt;"\t" &lt;&lt; user[list].gender &lt;&lt; "\t" &lt;&lt; user[list].course &lt;&lt; "\t" &lt;&lt; user[list].year &lt;&lt; "\t" &lt;&lt; user[list].section &lt;&lt; "    " &lt;&lt; user[list].studno &lt;&lt;"\n";
      }
      return;
  }
  </code></pre>
  
  <p>My previous question was about a student record program got on hold for being broad, so, taking the advice and answers from some users there, I started to search and take action, I'll be specific this time.</p>
  
  <p>So here's the whole code so far. My question is: how to clear the screen so that when you choose an option on the menu, you are then taken to that specific 'place' in the code and once you are done with that part of the program, clear the screen again and go back to the menu?</p>