title: Converting a string into an int array
body: <p>While programming in C I got stuck at the following code-snippet:</p>
  
  <p>While converting from char array <code>input</code> to integer array <code>digit</code>, only the ANSI code is converted to the digit array.</p>
  
  <p>How can I make sure the correct integer-value is given to this array ?</p>
  
  <p>This is the relevant code:</p>
  
  <pre><code>int main(void) {
      int x = 0;
      int y = 0 
      char input[12] = {0};
      int digit[12] = {0};
  
      scanf("%s", &amp;input[0]);
      fflush(stdin);
  
      while (input[y] != '\0') {
          if (isdigit(input[y])) {
              digit[x++] = input[y++];
              count++;
          }
          else y++;
      }
  }
  </code></pre>