What is the result of "new int[ 0 ]"? [closed]
- by ArunSaha
Possible Duplicates:
What does zero-sized array allocation do/mean?
C++ new int[0] — will it allocate memory?
int * p;
p = new int[ 0 ];
What is the expected outcome when new is called for zero number of elements? Is the outcome defined or undefined?
Further, is it okay to call
delete [] p;
on that pointer?
What is the intuition/analogy to this situation of pointer to an array of zero elements?
Thanks in advance. Regards,
Arun