If I were to declare a vector of complex classes e.g.
Code:
std::vector<MyClass*> vec;
, resize it (or not. either way it returns the same segmentation fault), and then check it by saying
Code:
MyClass*& a = vec[0];

if (a != (MyClass*)NULL) { etc; }
. Why would checking for null return a segfault? I've never had this problem before with vectors or just dynamically declared pointers. I tried resizing it, and initializing all the members to NULL.