怎么样判断一个变量或内存是在栈内还是在堆内呢??
求求![怎么样判断堆和栈 怎么样判断堆和栈](https://www.codebye.com/wp-content/uploads/2016/07/-1951893951-339973520.gif)
求求
![怎么样判断堆和栈 怎么样判断堆和栈](https://www.codebye.com/wp-content/uploads/2016/07/-1951893951-339973520.gif)
解决方案
40
http://stackoverflow.com/questions/13719563/how-to-find-if-a-variable-is-allocated-in-stack-or-heap
http://stackoverflow.com/questions/16709946/how-to-determine-if-returned-pointer-is-on-the-stack-or-heap
参照上面两个帖子,基本没有通用方法来判断;
http://stackoverflow.com/questions/16709946/how-to-determine-if-returned-pointer-is-on-the-stack-or-heap
参照上面两个帖子,基本没有通用方法来判断;