Click here to Skip to main content
15,305,375 members

Comments by Smith# (Top 1 by date)

Smith# 2-Dec-12 9:22am View
Yes correct, but on a straight case, int* pInt = new int[5], how does the run time delete[] 5 elements in memory? or is it not doing actually?

In a single memory allocation like int* pInt = new int(10), the run time deletes the single value @ pInt thus freeing a memory location of single int value.

How does a delete[] know it should free 5 elements memory in an int[5]?