did you try it? here's some sample code:
and this is what you get:
std::cout<<f->i<<std::endl; //line 16
basically, everything follows the rules of scope... you don't need to set the pointer to null because it doesn't exist after the code leaves the pointer's scope. you still need to free up the memory though--just because there's nothing holding it's location doesn't mean it's not there.
jshao@MCP ~/Programming/C++ $ g++ test.cpp -Wall -o test.exe
test.cpp: In function `int main()':
test.cpp:16: error: `f' undeclared (first use this function)
test.cpp:16: error: (Each undeclared identifier is reported only once for each
function it appears in.)
in reality, the only reason you need to set a pointer to null (or 0) is so that you don't try to access a memory location with (theoretically) nothing of use in it.