Convert String to int

This should work.

char myStr[3] = {'1','2',0};
int myInt = atoi(myStr);