title: How to use a bool sentinel value to end a while loop in C++?
body: <p>I am having trouble using the bool value of END to stop running the loop ( code below). The rest of the program works, but I cannot seem to get the loop to stop when I type end. Any suggestions?</p>
  
  <pre><code>bool END = false;
  while (!END)
  {
      cout &lt;&lt; "Please enter a song or END to terminate: ";
      getline(cin, track);
  
      results = binarySearch(tracks, numTracks, track);
  
      if (results == -1)
          cout &lt;&lt; track &lt;&lt; " is not on the set list.\n";
      else if (results != -1)
      {
          cout &lt;&lt; track &lt;&lt; " is on the set list.\n";
      }
  }
  </code></pre>