Use strtok to split the string into tokens, and use atoi on each one of them.
A simple example:
char c[] = "1 2 3"; /* our input */
char delim[] = " "; /* the delimiters array */
char *s1,*s2,*s3; /* temporary strings */
int a1, a2, a3; /* output */
s1=strtok(c,delim); /* first call to strtok - pass the original string */
a1=atoi(s1); /* atoi - converts a string to an int */
s2=strtok(NULL,delim); /* for the next calls, pass NULL instead */
a2=atoi(s2);
s3=strtok(NULL,delim);
a3=atoi(s3);
The tricky thing about strtok is that we pass the original string for the first token, and NULL for the other tokens.