Home > Back-end >  Class type pointer, delete object pointer collapse. The coma is now a free function problem, hope th
Class type pointer, delete object pointer collapse. The coma is now a free function problem, hope th

Time:01-11

[align=left]
 
//would class is a simple list, use malloc as node application memory
//in the clear function to use free release all node
//initialized in the constructor head node, so use new

Linker * arr=new Linker (a);
Char [] const s={' A ', 'B', 'C', 'D', 'E', 'F'};


//1 to add, delete, insert... .
Arr - & gt; The clear ();
The delete arr.
Arr=NULL;


[/align]

CodePudding user response:

The code is not complete, cannot judge

CodePudding user response:

Code is not complete, but look at your description, there is a constant string s, supposedly you free memory in the clear function estimation and it is related to the memory of the array itself can't be free
  • Related