3 ms·
??? Pointers, as per the standard, have an implicit conversion to bool that evaluates to true if and only if the pointer is not exactly nullptr. Code like:
by qsort 4y ago
???
Pointers, as per the standard, have an implicit conversion to bool that evaluates to true if and only if the pointer is not exactly nullptr. Code like:
if (ptr) {
...
}
is guaranteed to work the way you expect it to, regardless of how null pointers are implemented.