If the only pointer to some memory is a local variable in my main
function, and I exit the program by returning from main
, is that memory considered "still reachable"?
Similarly, if I exit by calling exit
in some function, is memory that is only pointed to by a local variable in that function (or a function that called it) considered "still reachable"? What about if I exit through other methods like abort
or _exit
?
I'm working in C, but I would also be interested in hearing if any of this works any differently in C++.