how can I check if an object exists in C++
问题 I am trying to write a function that will check if an object exists: bool UnloadingBay::isEmpty() { bool isEmpty = true; if(this->unloadingShip != NULL) { isEmpty = false; } return isEmpty; } I am pretty new to C++ and not sure if my Java background is confusing something, but the compiler gives an error: UnloadingBay.cpp:36: error: no match for ‘operator!=’ in ‘((UnloadingBay*)this)->UnloadingBay::unloadingShip != 0’ I can't seem to figure out why it doesn't work. Here is the declaration for