C++ Static Pointers

Started by
0 comments, last by joeG 24 years, 6 months ago
Well I already posted this message on the OpenGL forum before I knew about this one, but here's a basic rundown of what I wrote:

The code:

class Object
{
...
static vector instantiatedObjects;
...
};
vector Object::instantiatedObjects =
vector();

Small problem: the vector insantiatedObjects should actually be vector (the type Object* in template brackets) instantiatedObjects. I hope this helps.
The last line is in my main program module. The problem is that my program crashes after the last bit of source code. (I've checked with my debugger) Any suggestions?

JoeG

[This message has been edited by joeG (edited October 19, 1999).]

[This message has been edited by joeG (edited October 19, 1999).]

joeG
Advertisement

JoeG,

This may be a little offkey..but are you deleting the object held by the vector?

It could be that the problem is in the dtor of the object(s) your vector contains.

HTH,

-mordell

__________________________________________

Yeah, sure... we are laughing WITH you ...

This topic is closed to new replies.

Advertisement