|
|
|
|
|
by PaulDavisThe1st
547 days ago
|
|
NULL is not single type in any conventional sense (and is actually tricky to define in a way that makes it usable in the way most programmers expect). Thus: T1* a = NULL;
T2* b = NULL
a == b; /* may be undefined at present, depending on the nature of T1 & T2 */
|
|
here what standard says:
"A pointer to void may be converted to or from a pointer to any object type.
Conversion of a null pointer to another pointer type yields a null pointer of that type. Any two null pointers shall compare equal."
therefore, convert any of them or both to void amd compare. you'll get equality.