First point: there's almost never a good reason to use the array form of new or delete to start with -- use std::vector (or some other container) instead.
Second: back in the dark ages of C++, you had to specify the size of the array you were deleting, so if you used x = new T[N]
, the matching delete was delete [N] x
. The requirement to explicitly specify the size was removed long ago, but some compilers (especially those that care about backward compatibility with ancient code) still allow it.
Unless you really need to remain compatible with an ancient compiler (one that's 20 years old or so) you shouldn't use it. Then again, unless you need to remain compatible with a compiler so old it doesn't support any standard containers, you shouldn't be using the array form of new or delete in the first place. Just stop!