If I'm not mistaken, the following code will allocate 5 integer elements from memory to 'ptr':
int *ptr; ptr = new int;
If after this code I enter the following:
ptr = new int;
will the original 5 elements be overwritten or deallocated? Or will they just stay resident in memory for nothing?