WTF??

N

Noah Roberts

I have code that looks like the following:

void f()
{
Object * p = 0;
Object * p2 = availableptr;
Object * iter = 0;
std::map<int,int> serialMap;
// also tried std::map<int,int> serialMap = std::map<int,int>() even
though I can't fathom what happened the first way.

....
}

The serial map variable has an address until it reaches the point of
execute code where it is initialized...then it becomes a null
reference!!! In other words, &serialMap == 0 after the line that
declares/defines it!

All I can say is WTF?

I have never seen anything like this nor do I think I could replicate
it in code to post here. Has anyone seen this happen before? Any idea
what I am looking for?
 
N

Noah Roberts

Nevermind, this is just a failure of my understanding of what the
debugger is printing out. The 0 I was seing was not the pointer value
I asked for...it was trying to be fancy and printing out the count of
the items in the map.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,129
Latest member
FastBurnketo
Top