C89: On Memory Leak

//Test.cpp
 
_CrtDumpMemoryLeaks();

 

//Test.h
 
#define CRTDBG_MAP_ALLOC    
#include <stdlib.h>    
#include <crtdbg.h>    

 

Pointer with caution, do not seek death can not be used, with the possibility of an error !!!

Caution new malloc

When we allocate memory for a fixed time, the direct use of objects to allocate, so they do not seek death with the pointer.

 

When we allocate memory is dynamic, only to dynamically allocate memory space (new malloc) with a pointer

Guess you like

Origin www.cnblogs.com/k5bg/p/11118835.html