title: How to find the length of a string in one line in C programming?
body: <p>Here is a small snipped of code.</p>
  
  <pre><code>int len(char *str)
  {
      int count = 0;
      while(*str++)
          count++;
      return count;
  }
  </code></pre>
  
  <p>Now few days back I found a code which was able to this in one line. Basically there was some one line code in while's condition and that took care of finding the length of the string and returning it. It was dirty code? Yes, but it was interesting so I thought I would try to use it, but I can't seem to remember what it was exactly. So is there a way to do this in one line of code?</p>
  
  <p>Edit:
  Sorry for not mentioning the fact that no library calls like strlen. This function must be self-contained. </p>