共用方式為


編譯器錯誤 C2203

不能使用 delete 運算子指定陣列的界限

備註

使用 /Za (ANSI) 選項,delete運算子可以刪除整個數位列,但不能刪除數位的元件或特定成員。

Example

下列範例會產生 C2203:

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