Export (0) Print
Expand All

Compiler Error C2203

delete operator cannot specify bounds for an array

With the /Za (ANSI) option, the delete operator can delete an entire array but not parts or specific members of the array.

The following sample generates C2203:

// C2203.cpp
// compile with: /Za
int main() {
   int *ar = new int[10];
   delete [4] ar;   // C2203
   // try the following line instead
   // delete [] ar;
© 2015 Microsoft