Hi. Suppose u have the following function:
If i call the above function in main like this:Code:int *temp(int n){ int i; int *array = new int[n]; for (i=0;i<n;i++) array[i] = i; return array; }
4Mbytes of memory are allocated, even though the result of temp() is not returned to another pointer. Why? Can I "free" that memory?Code:temp(1000000);
Thanx




Reply With Quote