Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 3
    "Best"? Not always. Sometimes it is safe to do this, but other times it is better to handle NULL and 0 differently. Commented Dec 4, 2009 at 23:36
  • I'd argue that it is the best, but often collescing to a value such as -1 or int.max is better, but it's still the same solution. Commented Dec 4, 2009 at 23:41