demo.cpp
来自「linux下的垃圾收集」· C++ 代码 · 共 28 行
CPP
28 行
#include <stdio.h>
using namespace std;
/**
* 要想检测内存泄漏, 下面的代码必须包括
*/
#include "MemRecord.h"
#if defined( MEM_DEBUG )
#define new DEBUG_NEW
#define delete DEBUG_DELETE
#endif
class TestObj
{
public:
char z[15];
TestObj() { memset(z, 0, 15 ); }
virtual ~TestObj() {};
};
int main()
{
TestObj* pob = new TestObj;
TestObj* pObAry = new TestObj[26];
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?