As far as I know, no. Every new[] must be followed by a delete[], and every new must be followed by a delete.
Typically, this is what you'd use STL containers for.
@The illusionist mirage: sure, ¿who cares for undefined behaviour?
@OP:
nolyc wrote:
You're trying to do X, and you thought of solution Y. So you're asking about solution Y, without even mentioning X. The problem is, there might be a better solution, but we can't know that unless you describe what X is.