3 ms·
Well, since 0 is guaranteed to compare equal to the null pointer, my current code compare my pointers to it directly: if (ptr != 0) { foo(*ptr); } The type
by loup-vaillant 4y ago
Well, since 0 is guaranteed to compare equal to the null pointer, my current code compare my pointers to it directly:
if (ptr != 0) { foo(*ptr); }
The type mismatch is ugly, but that saves me an include (this particular code minimises its dependencies to maximise portability).