
Implement a function that cuts a string into tokens wherever any character from a caller-supplied delimiter set appears, and returns those tokens as a malloc'd, NULL-terminated array of strings.
split("cargo build --release", " -")Expected result
["cargo", "build", "release", NULL]For your own tracking. Tests grade your code.
split("one,two,,three", ",")Expected result
["one", "two", "three", NULL]split(",,,,", ",")Expected result
[NULL]Expected files
split.cAllowed functions
mallocAllowed headers

Implement a function that cuts a string into tokens wherever any character from a caller-supplied delimiter set appears, and returns those tokens as a malloc'd, NULL-terminated array of strings.
split("cargo build --release", " -")Expected result
["cargo", "build", "release", NULL]For your own tracking. Tests grade your code.
split("one,two,,three", ",")Expected result
["one", "two", "three", NULL]split(",,,,", ",")Expected result
[NULL]Expected files
split.cAllowed functions
mallocAllowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.
v0.40: Create exercises. Challenge the community.
Meet Studio →