title: Fast Method of Converting Character Array to ASCII Key Value
body: <p>I am making a program that reads a large amount of characters in a sequence from a file that consists of a-z and the number 0. An example would look like this:</p>
  
  <pre><code>a0dgiw00cffn0ai0cbiwa0...
  </code></pre>
  
  <p>I believe I converted this sequence to a character array with this:</p>
  
  <pre><code>strncpy(array, string.c_str(), sizeof(array));
  </code></pre>
  
  <p>And now I have an array that should look like this:</p>
  
  <pre><code>[a][0][d][g][i][w][0][0]...
  </code></pre>
  
  <p>So my question is, what is the most efficient way to convert all of the values inside the character array to ASCII key values? Most efficient as in least amount of time possible. If you do not understand what I mean by "ASCII key values", the final array should look like this:</p>
  
  <pre><code>[97][48][100][103][105][119][48][48]...
  </code></pre>
  
  <p><em>Side Note: An ASCII key values table can be found <a href="http://www.asciitable.com/" rel="nofollow">here</a>.</em></p>
  
  <p><em>Side Note: I already know how to convert the array values to ASCII, I am just looking for a much faster method.</em></p>
  
  <p>Thank you in advance.</p>