#include <stdio.h> #include <Windows.h> #include <assert.h> #include <crtdbg.h> struct tvt { int i; char c; char a[]; }; void Test() { char* p = new char[4]; assert(_CrtCheckMemory()); strcpy(p, "12345"); assert(_CrtCheckMemory()); } int main() { Test(); return 0; }
// Assertion failed: _CrtCheckMemory(), file e:\code\win32\test1\main.cpp, line 17
堆异常检测-MS-Visual Studio,布布扣,bubuko.com
原文:http://blog.csdn.net/arbboter/article/details/36894603