Sorry if this is a really dumb question but just when I thought I finally understood pointers I get this problem. Basically what I am having trouble with is that I don't understand how the createDevice works. If I create an IrrlichtDevice *irrlichtDevice and pass that pointer to some function and try to have that function irrlichtDevice = createDevice() then for some reason I can only irrlichtDevice from within that function and if I were to try to do something like while(irrlichtDevice -> run()) in main it gives me a segmentation fault. Is there a way around this. Does the device somehow go out of scope when that function ends?