   d3dclass constructor sets to 0xccccccc?
  In making my momentous shift to a more OOP style game structure, I created a framework class that contains D3D pointers and intitializes them, handles them, and releases them.  I did _not_ include a constructor or a destructor in the class definition (isn't that supposed to be OK?).Anyway, the default constructor for my class for some reason takes all my direct3d pointers and initializes them to 0xcccccccc instead of 0x00000000.  I immediately noticed this when I got an error for doing this:if(texture_pointer) texture_pointer->Release();in my MyD3DHandler::Cleanup() routine.Is this sort of intialization normal?  Does it indicate that something is wrong?  I thought that the default constructor was supposed to set all member variables to binary zero, so I really don't understand why this is happening.Thanks for your help!   
  Unless you set them yourself, uninitialized variables are just that - uninitialized.  Usually, in debug mode a compiler will set them to some value that is "obviously" not valid, such as 0xcccccccc, so that it will break, because an uninitialized pointer probably indicates a bug.  However, in release mode, they generally are not so kind and you are left with whatever they happen to be, which is why sometimes they will work and sometimes they won't, seemingly at random.In short, you've got to set the pointers in the constructors if you want them guaranteed to be NULL.   ;Quote:I thought that the default constructor was supposed to set all member variables to binary zeroTo clarify, this is absolutely not true.  Always, ALWAYS initialize your variables.   ;  If you use ATL's CComPtr COM "smart pointer," you won't need to write code to AddRef/Release your interfaces at all (though you'll still want to initialize them by using .Attach).   ;  OK, I assumed it must have been the debug setting that was doing it.  But still, I remember very clearly that my For Dummies book said that the implied (or default or whatever) constructor always takes care of setting all its members to NULL.So does this mean I need to do something like this?class MyD3DClass{    MyD3DCLass()    {    texture_pointer=0;    }    LPDIRECT3DTEXTURE texture_pointer}Or is that even necessary, since I could just set texture_pointer to 0 at the beginning of my MyD3DCLass::CreateTextures() routine?;Quote:Original post by synth_catBut still, I remember very clearly that my For Dummies book said that the implied (or default or whatever) constructor always takes care of setting all its members to NULL.If your book said this, get a new book.  It is absolutely never true in C++.The preferred method is with initializer lists:class MyClass{public:    MyClass();private:    int *m_pointer};MyClass::MyClass:    m_pointer(NULL){}-me   