title: convert ascii to integer
body: <p>I already kown how to convert，but the "while" doesn't stop ,it runs over and over.I don't know why? Is " string !='\0' " doesn't work? Is the char always ended with '\0'?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
     int ascii_integer(char *string){
     int result = 0;
    while (string !='\0')
    {
       if (*string &gt;='0' &amp;&amp; *string &lt;='9')
       {
          result *= 10;
          result += *string - '0';
       }
       string++;
    }
    return result;
  }
  int main(){
    char string[] = "12345";
    int result = ascii_integer(string);
    printf("%d\n",result);
  }
  </code></pre>