Quote
Well... no. Its handle is just an address and while it may be stored in a local pointer, when you leave the local scope without freeing the memory it is STILL allocated even if you no long have a pointer containing its handle. But the block of memory allocated remains and can be used if you have saved the handle somehow (like storing it in some pointer).
Yes I agree, but I was refering to the scope of the handle in which the pointer belongs. The variable stays in memory; however, without access to it, I dont believe it is worth of calling it a "global variable".
I wouldn't call this variable global even though it's memory stays allocated past the handles scope.
void foo(void) {
int *handle = new int(10);
}
This post has been edited by ImaSexy: 28 July 2011 - 08:37 AM

New Topic/Question
Reply



MultiQuote

|