摘要:
Operator new allocates memory from the heap, on which an object is constructed. Standard C++ also supports placement new operator, which constructs an object on a pre-allocated buffer. This is useful ... 阅读全文
摘要:
1、new和malloc()有什么区别; a. new 是 C++ 中的东西,而 malloc 是 C 中的东东 b. new 是操作符,而 malloc 是函数(?不记得是函数还是宏了) c. new 可以对变量初始化,调用构造函数,而 malloc 没有这个功能 d. new 是异常安全的,分配失败可以捕获到 std::bad_alloc 异常 2、ASSERT和VERIFY有什么区别; ... 阅读全文