VS2017下内存泄漏检测方法 在代码最前面加上#define CRTDBG_MAP_ALLOC,在main函数最后返回之前使用_CrtDumpMemoryLeaks(); 并包含crtdbg.h文件 #define CRTDBG_MAP_ALLOC #include<iostream> #include<crtdbg.h> using namespace std; int main() { int *a = new int[10