title: Why system("CLS") in while is not working?
body: <p>I want to clear the screen after select option, but I don't know somehow it is not working. It will show the things in Display() function and the Create New Purchase and other things. It is because in the while loop?</p>
  
  <pre><code>while (selection != -1) // While for create new purchase 
          {
              cout &lt;&lt; "Create New Purhcase" &lt;&lt; endl &lt;&lt; endl;
              cout &lt;&lt; "1. Display Item" &lt;&lt; endl;
              cout &lt;&lt; "2. Create a New Purchase" &lt;&lt; endl &lt;&lt; endl &lt;&lt;endl;
              cout &lt;&lt; "0. Back to Main Menu" &lt;&lt; endl; 
              cout &lt;&lt; "Enter Option:";
  
              cin &gt;&gt; selection;
  
              //Back to main menu 
              if (selection == 0)
              {
                  system("CLS");
                  break;
              }
              if (selection == 1)
              {
                  system("CLS");
                  cout &lt;&lt; "Display Menu" &lt;&lt; endl;
                  Display();
              }
  
  void Display()
  {
  system("CLS");
  temp = itemHead; //start at the first node
  cout &lt;&lt; "Dispaly Menu" &lt;&lt; endl &lt;&lt; endl; 
  
  while (temp != NULL)
  {
      cout &lt;&lt; "ID:" &lt;&lt; temp-&gt;itemid &lt;&lt; endl; 
      cout &lt;&lt; "Item Name:" &lt;&lt; temp-&gt;name &lt;&lt; endl;
      cout &lt;&lt; "Item Type:" &lt;&lt; temp-&gt;type &lt;&lt; endl;
      cout &lt;&lt; "Item Price" &lt;&lt; temp-&gt;cost &lt;&lt; endl;
      cout &lt;&lt; endl &lt;&lt; endl;
      temp = temp-&gt;next; //forward to the next node
  }
  </code></pre>
  
  <p>}</p>