I don't understand something in C++ - I create some pointer on class and set it to null.
Now I call some function with this null pointer and the function succeeds. Why doesn't it crash ?
class Entity
{
public:
void Print() const
{
std::cout << "Print" << std::endl;
}
};
int main()
{
Entity* ptr = nullptr;
Entity& _ref = *ptr; // No crash here - I expected a null pointer exception
_ref->Print();
}