Export (0) Print
Expand All
Expand Minimize

Compiler Error C2203

Error Message

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;

Community Additions

© 2014 Microsoft