Contents Up << >>

What if I forget the "[]" when deleteing array allocated via new Fred[n]?

All life comes to a catastrophic end.

It is the programmer's --not the compiler's-- responsibility to get the connection between new[] and delete[] correct. If you get it wrong, neither a compile-time nor a run-time error message will be generated by the compiler. Heap corruption is a likely result. Or worse. Your program will probably die.