Don't know is it the best way but you can do like this. Parse the string until the space (' ') and the number until the space convert to int element of array.
Thats what i thought i would be able to do but i couldn't get something like that to work. I am probably doing something wrong.
I thought something like below would do the trick but i keep getting cast errors.
while (*string != '\0')
{
for (i = 0; i < strlen(string); i++)
{
converted[i] = atoi((int)string[i]);
}
}