user23997: I have a char* array which looks like this "T 20" and I'd like to extract the "20" and convert it in to an integer. I was thinking of using atoi() but it seems that function will operate on the entire string, not just the bits I want. Memory is a bit tight so is there a function similar to atoi() which allows you to specify which charters to operate on?

user17164: How about
char array[5] = "T 20";
int num = atoi(array+2);

This obviously assumes that all your strings are of the same format "A NN". If not, you can try parsing it using strtok(). See this excellent answer.

23997: <p>I have a char* array which looks like this "T 20" and I'd like to extract the "20" and convert it in to an integer. I was thinking of using atoi() but it seems that function will operate on the entire string, not just the bits I want. Memory is a bit tight so is there a function similar to atoi() which allows you to specify which charters to operate on?</p>
 17164: <p>How about</p>

<pre><code>char array[5] = "T 20";
int num = atoi(array+2);
</code></pre>

<p>This obviously assumes that all your strings are of the same format <code>"A NN"</code>. If not, you can try parsing it using <code>strtok()</code>. See this <a href="https://arduino.stackexchange.com/a/1033/17164">excellent answer</a>.</p>
