title: the scope of a pointer?
body: <p>Ok, so I did find some questions that were almost similar but they actually confused me even more about pointers. </p>
  
  <p><a href="https://stackoverflow.com/questions/2715198/c-pointer-objects-vs-non-pointer-objects-closed">C++ Pointer Objects vs. Non Pointer Objects</a></p>
  
  <p>In the link above, they say that if you declare a pointer it is actually saved on the heap and not on the stack, regardless of where it was declared at. Is this true ?? Or am I misunderstanding ??? I thought that regardless of a pointer or non pointer, if its a global variable, it lives as long as the application. If its a local variable or declared within a loop or function, its life is only as long as the code within it.</p>