Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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;
}