Hacker News new | past | comments | ask | show | jobs | submit login

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).



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: