title: changing pointer of a dynamically allocated array
body: <p>When we declare something dynamically like this </p>
  
  <pre><code>int *ptr = new int [100];
  </code></pre>
  
  <p>and then change the pointer address (i.e point it to something else)</p>
  
  <pre><code>int pointer[5] = {1,2,1,3,1,};
  ptr = pointer ; 
  </code></pre>
  
  <p>now what happens to that memory which contained 100 integers?</p>
  
  <p>is there anyway to regain control of that memory ? and if not, does it lead to a memory leak?</p>