When a pointer is created in scope, what happens to the pointed to variable when the pointer goes out of scope?

前端 未结 4 1238
猫巷女王i
猫巷女王i 2021-01-02 16:14

The title says it all.

I found an old question that is essentially the same, but I needed a tiny bit further clarification.

In this question the accepted an

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-02 16:21

    I'd say "nothing" (to answer the title), if it were enough for SO to consider it an answer.

    As for your million pointers to characters, whereas the pointers will get popped (though you gotta have quite a stack to hold million pointers) the data they point to will haunt your memories.

提交回复
热议问题