title: Why does my object created with "new" not exist out of scope?
body: <p>Hi and sorry for this propably incredibly stupid question - complete C++ beginner here..
  I understood that creating objects with the "new" operator creates them on the heap and that they therefor should be global, right? 
  I tried this with this code, but end up getting an error, that I read as "out of scope" - what am I not seeing here, guys? </p>
  
  <pre><code>int main()
  {   
      bool mainLoop = true; 
      do 
      {
          string userInput1, userInput2;
          cout &lt;&lt; endl &lt;&lt; "Please enter a new recipe, or press X to quit: " &lt;&lt; endl &lt;&lt; endl;
          cin &gt;&gt; userInput1; 
          if (userInput1 != "x") 
          {
              cout &lt;&lt; endl &lt;&lt; "Please enter the recipes description: " &lt;&lt; endl &lt;&lt; endl;
              cin &gt;&gt; userInput2;
              Recipe *gulasch1 = new Recipe (userInput1, userInput2);
              gulasch1-&gt;speak(); // this is just to try out if this outputs anything, and it does
          }
          else 
          {
              cout &lt;&lt; "Thanks and goodbye!" &lt;&lt; endl; 
              mainLoop = false;
          } 
      } while (mainLoop == true);
  
      gulasch1-&gt;speak(); // why does this throw an error? ('gulasch1': undeclared identifier)
  
      return 0;
  } 
  </code></pre>
  
  <p>Sorry if this is duplicate (I imagine it has to be, but I couldn't find anything that answered my question. 
  Thanks for the help, guys! </p>