The string is in this form:
123 456\n
My basic idea is to find the whitespace by a for-loop:
int i=0;
for (i=0;isdigit(str[i]);i++){
}
char *dest1;
strncpy(dest1, str, i-1);
dest1[i]='\0';
And for the second int, I did that again:
int j=i+1;
for (;isdigit(str[j]);j++){
}
char *dest2;
strncpy(dest2; (str+j); j-i);
dest2[j-i+1]='\0';
int from = atoi(dest1);
int to = atoi(dest2);
But the second time I did this, Xcode said 'too few arguments provided to function-like macro invocation' && 'expression result unused'.
But they are exactly the same syntax...Someone please tell me where I did wrong?