You could use a number of ways to to do it without literally writing the delete operator in your program:
#include <memory>
int main()
{
int *ptr=new int[20];
std::allocator<int>().deallocate(ptr, 20);
}
#include <memory>
int main()
{
int *ptr=new int[20];
std::default_delete<int[]>()(ptr);
}
#include <memory>
int main()
{
int *ptr=new int[20];
std::unique_ptr<int[]> p(ptr);
}
#include <boost/smart_ptr.hpp>
int main()
{
int *ptr=new int[20];
boost::scoped_array<int> p(ptr);
}
etc.
All of these somewhere internally execute delete[] with a copy of your ptr as the argument which is what actually deallocates that memory.