Hello
If I have a function which creates a pointer like this:
int number = 44; //global
void MyFunction() {
int* pNum = &number;
}
Then as soon as MyFunction returns then pNum goes out of scope and
becomes no more.
But I am looking at some code that does this:
CRQueue::ptr_type pqueue = thisThread->GetQueue();
The next step is that a timer is setup to periodically exercise some
function using some items that have been added to the queue.
As the pqueue is reference counted, I am assuming it doesn't go out of
scope and so the queue will still be valid (presumably until all items
in the queue have benn processed by the timer function?).
I am really just looking for confirmation that this is possible to
do. If so, I then need to read up on reference counted pointers. Any
hints on good sources of info would be appreciated.