title: Populate int array with a char array full of numbers in C (char array to int array)
body: <p>My Char array allows for a user to input a purely numeric string, thus storing each digit in its own array space. I need to assign each element of the char array to the corresponding location in the int array. How do i store the actual numeral rather than the the ASCII equivalent </p>
  
  <p>ex. if I enter 9 as the string, i don't want  57 (the ASCII value) but the numeral 9.</p>
  
  <pre><code>int main()   
  {
  
      int x[256] = {0};
      int y[256] = {0};
  
      char temp1[256] = {0};
      char temp2[256] = {0};
  
      char sum[256] = {0};
      printf("Please enter a number: ");
      scanf("%s", &amp;temp1); 
  
      printf("Please enter second number: ");
      scanf("%s", &amp;temp2);
  
      for(i=0; i&lt;256; i++)
      {
          x[i] = ((int)temp1[i]);
          y[i] = ((int)temp2[i]);         
      }
  </code></pre>