title: C++ delete array crashes
body: <p>This is my code...</p>
  
  <pre><code>int* getA(int no)
  {
     int *a = new int[no];
     return a;
  }
  
  void main()
  {
     int* a = getA(10);
     delete []a;
  }
  </code></pre>
  
  <p>When I delete the array a in main it crashes... what is the reason??</p>
  
  <p>The error is
  "Windows has triggered a breakpoint in Final.exe. This may be due to a corruption of the heap, which indicates a bug in Final.exe or any of the DLLs it has loaded..........."
  But I am able to assign and access the elements of a in the main method but when I try to delete it is crashing....</p>