先上代码
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);就这么一句
然后就是debug了 不是run哦。
然后在输出窗口就可以看到了
Detected memory leaks!
Dumping objects ->
d:/program files/microsoft visual studio 8/vc/include/crtdbg.h(1150) : {110} normal block at 0x003B9BA8, 40 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
程序“[2760] t1.exe: 本机”已退出,返回值为 0 (0x0)。
40 bytes 10个int没错。