妈了个逼, 这段简单的STL都内存泄露了?哪出问题了?
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#include <vector>
using namespace std;
int main()
{
int iarr[]={3,2,5,6,33,4,1,9};
vector<int> arr(iarr, iarr+sizeof(iarr)/sizeof(*iarr));
system("pause");
_CrtDumpMemoryLeaks();
return 0;
}
调试信息如下
VC03
Detected memory leaks!
Dumping objects ->
{53} normal block at 0x00372F20, 32 bytes long.
Data: < > 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00
Object dump complete.