I was reading this question :
In c++11, does dynamic_cast return nullptr or 0?
I learned that the result of a dynamic_cast can be the null value for that particular type:
Consider a variable char * ptr. It's type is (unsurprisingly) char *. But the type of nullptr is the special type nullptr_t. So when we write something like ptr = nullptr, some technical things must happen
nullptr must be implicitly converted to char *. The result of this conversion is set as the new value of ptr. The null value for char * is the result of converting nullptr to char *. Conceptually, it's still nullptr, but with a different type (char *). This null value is distinct from the null value of int * or string * or any other pointer type. We tend to think of these null values as just nullptr (or 0), but each one is really a distinct value from a different type. (By the way, the same conversion happens for comparison using ==).
So what are the different null pointer types ? Does it really matter ? Is it sufficient in any check (where we want to determine if something is null) to simply check if == to std::nullptr ?