title: Memory management scope in C/C++
body: <p>When freeing memory in C and C++, do I only need the memory address or does it require any specific variable?</p>
  
  <p>So if I were to do something such as:</p>
  
  <pre><code>int* test()
  {
      int* x = new int(5);
      return x;
  }
  
  int main(int argc, char** argv)
  {
      int* y = test();
  
      delete y;
  
      return 0;
  }
  </code></pre>
  
  <p>Would this cause memory leaks? Thanks!</p>