#includeint * get() { int b = 3; return &b;}void removeStack() { int k = 5;}int main() { int *x = get(); removeStack(); std::cout<<*x;}
如果不调用removeStack打印出来是3,如果调用打印出来则是5!
本文共 271 字,大约阅读时间需要 1 分钟。
#includeint * get() { int b = 3; return &b;}void removeStack() { int k = 5;}int main() { int *x = get(); removeStack(); std::cout<<*x;}
如果不调用removeStack打印出来是3,如果调用打印出来则是5!
转载于:https://www.cnblogs.com/withparadox2/p/5802629.html