I've heard that accessing a pointer whose value is null is safe since you are not setting any data to it or from it, you are just accessing it.
But I also heard that accessing what it points to (when it's null) isn't safe, why is that?
If you are accessing to what it points to (when it's null) aren't you accessing nothing?
I think that there shouldn't be any issues with that unless you are setting values to something from it.
I've heard that from many people tho I never experienced any crashes or bugs related to that (when reading data from inside a pointer that is null), when I catch an exception I just let it be since I'm not setting any data from it to something. Is that ok?
int x;
int* px = &x;
int* pn = nullptr;
if (px==px) { do something;}