Skip to main content
2 of 2
Add info about strtok()
Fauzan
  • 375
  • 1
  • 8

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.

Fauzan
  • 375
  • 1
  • 8