basics · intermediate · ~15 min
Tokenise a small input line.
Implement int parse_pair(const char *s, int *a, int *b) parsing two non-negative integers separated by a single space (e.g. "12 34"). Return 1 on success, 0 otherwise.
int parse_pair(const char *s, int *a, int *b) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.