title: Where is a std::string allocated in memory?
body: <p>Here is a function:</p>
  
  <pre><code>void foo() {
     string str = "StackOverflo";
     str.push_back('w');
  }
  </code></pre>
  
  <p>When we declare the string inside the function, is it stored on the Stack or Heap? Why?</p>
  
  <pre><code>string foo() {
     string str = "StackOverflo";
     str.push_back('w');
     return str;
  }
  </code></pre>
  
  <p>Can we return the string reference and continue using somewhere else in the program?</p>