If I were to declare a vector of complex classes e.g., resize it (or not. either way it returns the same segmentation fault), and then check it by sayingCode:std::vector<MyClass*> vec;
. 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.Code:MyClass*& a = vec[0]; if (a != (MyClass*)NULL) { etc; }