title: When a pointer is created in scope, what happens to the pointed to variable when the pointer goes out of scope?
body: <p>The title says it all. </p>
  
  <p><a href="https://stackoverflow.com/questions/4570210/c-pointer-scope">I found an old question that is essentially the same</a>, but I needed a tiny bit further clarification.</p>
  
  <p>In this question the accepted answer says:</p>
  
  <blockquote>
  <pre><code>char* text = "Hello, world"; 
  </code></pre>
    
    <p>Here an automatic variable (a pointer) is
    created on the stack and set to point to a value in constant memory,
    which means:</p>
    
    <ul>
    <li>the string literal in "" exists through the whole program execution.</li>
    <li>you are not responsible for "allocating" or "freeing" it </li>
    <li>you may not
    change it. If you want to change it, then you have to allocate some
    "non-constant memory" and copy it there.</li>
    </ul>
  </blockquote>
  
  <p>Is this saying that the pointer gets deleted, but not the data the pointer is pointing to?
  If I were to create 1,000,000 pointers to characters in a function, when they go out of scope would all of my memory be released? Or just the memory required to make the pointers, leaving the actual characters themselves behind to hog up all my memory? </p>