C语言的内存管理问题

2019-02-26  本文已影响0人  听话君

Let's See a Experiment


Why

Because the first function allocate a buffer on stack and return it, and second

function allocate a buffer on heap. Heap memory won't be free after call

the function, but the stack behavior oppositely. So it's why I gotten a

warning from GCC.


上一篇 下一篇

猜你喜欢

热点阅读