title: convert chars form char array to integer in C
body: <p>from a char array like {T,E,S,T,1,2,3,E,N,D}, I need to get an integer from certain positions. Following with the example, I would like to get an integer from positions 4, 5, 6. So, myInt = 123.
      I tried following method but haven't got desired integer.</p>
  
  <pre><code>char  receivedata[bytes];
  
  concatVars = concatenate(atoi(receivedata[6] - '0', receivedata[7] - '0');
  concatVars = concatenate(concatVars, receivedata[8] - '0');
  
  unsigned concatenate(unsigned x, unsigned y) {
      unsigned pow = 10;
      while(y &gt;= pow)
          pow *= 10;
      return x * pow + y;
  }
  </code></pre>