c++ - const指针需要释放吗?
ringa_lee
ringa_lee 2017-04-17 13:54:51
0
3
502

它是在堆里还是在栈里?

ringa_lee
ringa_lee

ringa_lee

reply all(3)
巴扎黑

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!