title: I want to plus the number form string datatype
body: <p>I have the following input as string:</p>
  
  <pre><code>Num: 12345
  </code></pre>
  
  <p>I would like to print out the sum of digits from the input (1+2+3+4+5 = 15):</p>
  
  <pre><code>total:15
  </code></pre>
  
  <p>I tried, but there is a problem with <code>atoi()</code> in the <code>for</code> loop and I got an error:</p>
  
  <blockquote>
    <p>[Error] invalid conversion from 'char' to 'const char*'</p>
  </blockquote>
  
  <p>How can I fix that or how can I resolve it in an easier way?</p>
  
  <pre><code> #include &lt;stdio.h&gt;
   #include &lt;ctype.h&gt;
   #include &lt;stdlib.h&gt;
   #include &lt;string.h&gt;
  
   char numstr[100];
   int total = 0;
  
   main(){
       printf("Num:");
       scanf("%s", numstr);
  
       for(int i = 0; i &lt; strlen(numstr); i++){
           total += atoi(numstr[i]);
       }
       printf("%d", total);
   }
  </code></pre>