title: C: is there any benefit in using for(;;)?
body: <p>I found this implementation for <code>char * strchr (const char *string, int c);</code>:</p>
  
  <pre><code>for (;;) 
    if (*string == c)
      return (char *) string;
    else if (*string == '\0')
      return NULL;
    else
      string++;
  </code></pre>
  
  <p>For me, though, it would be equivalent to do the following, which would be way easier to read:</p>
  
  <pre><code>while (*string != c &amp;&amp; *string != '\0')
    string++;
  
  return (*string == c) ? ((char *) string) : (NULL);
  </code></pre>
  
  <p>I take it there is some reason for the libc to implement the first one. But any take on what's the reason behind it?</p>