加入以下代码即可检测内存泄漏:
#define _CRTDBG_MAP_ALLOC #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif inline void EnableMemLeakCheck(){
int* a = new int[100]; return 0;
/* |
加入以下代码即可检测内存泄漏:
#define _CRTDBG_MAP_ALLOC #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif inline void EnableMemLeakCheck(){
int* a = new int[100]; return 0;
/* |