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.
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.
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.
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.
Go here to test? C++ online compilation and execution