
Implement gm_strcspn, your own strcspn, which scans a string from the beginning and returns the index of the first character that appears in a given reject set.
gm_strcspn("grep found nothing", "xyz")Expected result
18For your own tracking. Tests grade your code.
gm_strcspn("branch", "aeiou")Expected result
2gm_strcspn("", "abc")Expected result
0Expected files
strcspn.cAllowed functions
None. Write every helper yourself.
Allowed headers
Standard C library
Implements the contract of a function from the standard C library.

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement gm_strcspn, your own strcspn, which scans a string from the beginning and returns the index of the first character that appears in a given reject set.
gm_strcspn("grep found nothing", "xyz")Expected result
18For your own tracking. Tests grade your code.
gm_strcspn("branch", "aeiou")Expected result
2gm_strcspn("", "abc")Expected result
0Expected files
strcspn.cAllowed functions
None. Write every helper yourself.
Allowed headers
Standard C library
Implements the contract of a function from the standard C library.

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.