Should i use delete[] in a function? <pre><code>void work() { int *p; p=new int[10]; //some code.... } </code></pre> <p>I have a short question that in the <strong>work</strong> function, should i use delete[] operator? since when <strong>work</strong> function is over, <strong>p</strong> will be destroyed, which is wrong or right ? (My English is bad, i am sorry).</p>