Let's See a Experiment
![](https://img.haomeiwen.com/i15903957/1892b8ea9ff3c5ef.jpg)
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.
网友评论