title: C++ Menu Ordering System won't accept multiple words when inputting to the txt file
body: <p>My code below, whenever I input the menu items, will automatically end the program if I add more than one word such as &quot;Tequila Sunrise&quot; rather than &quot;Tequila&quot;. How do I fix this to make it so I can add items with more than one word in the name?</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main() {
      // Restaurant Side Title
      cout &lt;&lt; &quot;Welcome to the Menu Ordering System. \n\n\n&quot;;
  
      // Create a txt file to store the menu
      fstream MenuWriteFile(&quot;drinksmenu.txt&quot;);
      fstream MenuPricesFile (&quot;drinksprices.txt&quot;);
      
      // Write the menu to the file
      string myDrinks;
      double drinksPrices;
      int i;
      cout &lt;&lt; &quot;Please enter your first drink: &quot;;
      cin &gt;&gt; myDrinks;
      MenuWriteFile &lt;&lt; myDrinks &lt;&lt; endl;
      cout &lt;&lt; &quot;Price: &quot;;
      cin &gt;&gt; drinksPrices;
      MenuPricesFile &lt;&lt; drinksPrices &lt;&lt; endl;
      cout &lt;&lt; &quot;To add another drink type 1, if not type 0: &quot;;
      cin &gt;&gt; i;
      while (i == 1) {
          cout &lt;&lt; &quot;Please enter your next drink: &quot;;
          cin &gt;&gt; myDrinks;
          MenuWriteFile &lt;&lt; myDrinks &lt;&lt; endl;
          cout &lt;&lt; &quot;Price: &quot;;
          cin &gt;&gt; drinksPrices;
          MenuPricesFile &lt;&lt; drinksPrices &lt;&lt; endl;
          cout &lt;&lt; &quot;To add another drink type 1, if not type 0: &quot;;
          cin &gt;&gt; i;
      }
      
      MenuWriteFile.close();
      MenuPricesFile.close();
      
      // Create a text string, which is used to output the text file
       string myText;
  
       // Read from the text file
       ifstream MenuReadFile(&quot;drinksmenu.txt&quot;);
  
       while (getline (MenuReadFile, myText)) {
         cout &lt;&lt; &quot;\n\n&quot; &lt;&lt; myText &lt;&lt; &quot;\n&quot;;
       }
  
       // Close the file
       MenuReadFile.close();
      return 0;
      }
  </code></pre>