I have a string with the following format:
start 123
I am parsing it that way:
if (strstr(line, "start") == line) {
int number = -1;
if (sscanf(line + strlen("start "), "%d", &number) == 1) {
printf("start %d\n", number);
}
}
Is there any better way in C?
strtok().sscanf()is probably the best way though.