delete3.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 39 行

C
39
字号
#include <new>int i;extern "C" int printf (const char *, ...);template <class T, class U> struct map {  ~map ();};template <class T, class U>map<T, U>::~map (){}struct SomeClass { };void* operator new(size_t numBytes, SomeClass&, const std::nothrow_t&) throw(){  return operator new(numBytes, std::nothrow);}void operator delete(void* pMemory, SomeClass&, const std::nothrow_t&) throw(){  i = 7;  return operator delete(pMemory);}intmain(){  map< int, int>* pMap = new map< int, int>;    delete pMap;    if (i == 7)    return 1;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?