巴扎黑2017-04-17 13:56:51
const is on the stack, and the stack space is automatically released, so you don’t have to worry about it;
Heap space is generally applied for by new and malloc, and you need to release it.
ringa_lee2017-04-17 13:56:51
The memory pointed to by the pointer is allocated on the stack and does not need to be released manually. The memory allocated on the heap needs to be released manually.
I suggest spending some time reading some related books.