Practice ยท 1 of 2
Split Without Mutating
Implement span-based splitting. The boilerplate declares:
``c
typedef struct { const char *start; size_t len; } Span;
/* fills spans (array of capacity cap) with the ','-separated tokens of
line (NOT modified). Empty tokens ARE reported (len 0).
Returns the number of spans written, or -1 if more than cap needed. */
int split_spans(const char *line, Span *spans, size_t cap);
``
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Parse Gym