Skip to main content

Practice · 1 of 2

Split Without Mutating

CHALLENGE
Difficulty: intermediate+25 XP

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); ``

Back to lesson: Practice: Parse Gym