Search code examples
c++pointersstackstack-unwinding

Pointer validity after stack unwinding


In C++ does a pointer remains valid after stack unwinding or not?


Solution

  • It depends on what your pointer is pointing to. If it points to heap memory, it still remains valid. If it points to stack memory, it becomes invalid.