C++的new和delete详解
1、new操作符的三种使用方式plain new,nothrow new和placement new。(1)plain new顾名思义就是普通的new,只是用于分配内存。在C++中是这样定义的:void* operator new(std::size_t) throw(std::bad_alloc);void operator delete(void *) throw();提示:plain new在分配失败的情况下,抛出异常std::bad_alloc而不是返回NULL,因此通过判断返
复制链接