title: atoi implementation in C
body: <p>I can't understand the following <code>atoi</code> implementation code, specifically this line:</p>
  
  <pre><code>k = (k &lt;&lt; 3) + (k &lt;&lt; 1) + (*p) - '0';
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>int my_atoi(char *p) {
      int k = 0;
      while (*p) {
          k = (k &lt;&lt; 3) + (k &lt;&lt; 1) + (*p) - '0';
          p++;
       }
       return k;
  }
  </code></pre>
  
  <p>Can someone explain it to me ?</p>
  
  <p>Another question: what should be the algorithm of <code>atof</code> implementation ?</p>