Why “delete [][]… multiDimensionalArray;” operator in C++ does not exist

后端 未结 9 987
清酒与你
清酒与你 2021-02-05 06:09

I was always wondering if there is operator for deleting multi dimensional arrays in the standard C++ language.

If we have created a pointer to a single dimensional arra

9条回答
  •  孤城傲影
    2021-02-05 06:55

    Technically, there aren't two dimensional arrays in C++. What you're using as a two dimensional array is a one dimensional array with each element being a one dimensional array. Since it doesn't technically exist, C++ can't delete it.

提交回复
热议问题