title: How do you use atoi to assign individual elements of a char array?
body: <p>So as we all probably know, the <code>atoi</code> converts a char to a number. But, what do you do if you only want one of the array elements instead of the whole array?</p>
  
  <p>Please look at the following:</p>
  
  <pre><code>for (h = 0; h &lt; 5; h++)
  {
      num[h] = atoi(temp[h]);
  }
  </code></pre>
  
  <p>Assume that num is an array of type <code>int</code> and that temp is and array of type <code>char</code>. This gives me one of those annoying conversion problems:</p>
  
  <blockquote>
    <p>Invalid conversion from 'char' to 'const char *'</p>
  </blockquote>
  
  <p>Any suggestions on how to convert a single element of a char array to an int using atoi?</p>