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

后端 未结 9 992
清酒与你
清酒与你 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:43

    Well, I think it is easy to implement, but too dangerous. It is easy to tell whether a pointer is created by new[], but hard to tell about new[]...[](if allowed).

提交回复
热议问题