int main()
{
char inputp1[32], inputp2[32];
char input[32];
printf("-> ");
scanf("%s", input);
strcpy(inputp1, strtok(input , " ,.-"));
strcpy(inputp2, strtok(NULL, " ,.-"));
printf("%s\n", inputp1);
printf("%s\n", inputp2);
}
With this I can enter:
-> 10.10 // my input
10
10
And its the same with 10-10 and 10,10 but using 10 10 does this:
-> 10 10
Segmentation fault: 11
Any ideas?
Note: if this is a dupe just tell me and if it fixes this ill delete this post. Thanks.