标签: c++ c++11 visual-c++ c++builder c++14
删除和删除[]的一般等价已被多次询问和回答。但是,我想知道一个元素数组的特殊实例,它是否相当于一个元素?
以下两个代码示例中的所有四个都应该是等效的吗?
char * ch = new char; delete ch; char * ch = new char; delete[] ch; char * ch = new char[1]; delete ch; char * ch = new char [1]; delete[] ch;