This may sound a bit strange, but if I have the code uses delete [] as follows:
int main()
{
int *test = new int(5);
delete [] test //Does this work?
// delete test (This is the standard syntax)
}
Of course, I tried to compile and run, and delete [] didn't return any errors. According to http://www.cplusplus.com/reference/new/operator%20delete[]/, delete[] operator first calls the appropriate destructors for each element in the array (if these are of a class type), and then calls an array deallocation function. I'm not 100% sure what array deallocation function is, but I presume this will not cause memory leak?