title: Do I need to delete pointer in stack, which is created in heap?
body: <pre><code>int *createInt()
  {
     int *a = new int;
     return a;
  }
  
  int main()
  {
     int *x = createInt();
     *x = 10;
     cout &lt;&lt; *x &lt;&lt; '\n';
     delete x; // do I need this?
     return 0;
  }
  </code></pre>
  <p>DO I need delete x? If i don't, will it cause a memory leak problem?</p>