title: How to check if a string is a number?
body: <p>I want to check if a string is a number with this code. I must check that all the chars in the string are integer, but the while returns always isDigit = 1. I don't know why that if doesn't work.</p>
  
  <pre><code>char tmp[16];
  scanf("%s", tmp);
  
  int isDigit = 0;
  int j=0;
  while(j&lt;strlen(tmp) &amp;&amp; isDigit == 0){
    if(tmp[j] &gt; 57 &amp;&amp; tmp[j] &lt; 48)
      isDigit = 0;
    else
      isDigit = 1;
    j++;
  }
  </code></pre>