Hey wonderful guest! Please take a minute and register for an account here at codeleakers.com. It takes less than a minute and you will feel better about yourself and life in general. If you do not wish to register, you are still free to browse the site. Thanks!

C++ Help needed

I posted this on game dev threads, and also c++, I'm pretty intermediate with c++, I've only used it for work everyday for 10+ years, so I was shocked when the following code didn't work, and the reason its not working still eludes me, I figured I moght as well post it here too.

When the function GetFont is called, the debugger shows the RESOURCEMANAGER, a singleton, as being null, but a breakpoint in the resourcemanager's constructor shows fonts contains a pointer to all fonts loaded in said constructor, very puzzling to me.

Its probably something stupid I overlooked, probably overtired at this point.

0

Last edited by RogerWilco; 03-23-2012 at 11:26 AM.
Reason: I had filename in quotes when i typed the post

Okay, here's the problem, something with the way I passed the pointer, it probably should have been passes as a reference to a pointer, like &*

I'm not sure if you are referring to a putting a message box in the post so you can read it better, or you are telling me to have a message box pop up with the contents of the memory address.

If its the second one, which I think is what you mean, I have a debugger running, meaning when I insert a breakpoint I can see the whole data structure, in fact I can see the whole program in memory.

Now that said the problem is this instance is returning NULL! empty! nada! zip! zilch! 0! etc.

Yet the data exists, its like the pointer is returning a completely separate instance. the pointer points to 0x00000, and I cant figure out why. I am trying a new way of doing things, I have a way that works, I was just experimenting. I don't think I should have even posted this here, I don't think we all have the same definition of "coder"