
Implement gm_strchr, your own strchr, which scans a string for the first occurrence of a character and returns a pointer to it.
gm_strchr("rebase main", 'm')Expected result
mainFor your own tracking. Tests grade your code.
gm_strchr("git status", 'z')Expected result
(null)gm_strchr("commit", '\0')Expected result
(empty result)
Expected files
strchr.cAllowed functions
None. Write every helper yourself.
Allowed headers
Standard C library
Implements the contract of a function from the standard C library.

Implement gm_strchr, your own strchr, which scans a string for the first occurrence of a character and returns a pointer to it.
gm_strchr("rebase main", 'm')Expected result
mainFor your own tracking. Tests grade your code.
gm_strchr("git status", 'z')Expected result
(null)gm_strchr("commit", '\0')Expected result
(empty result)
Expected files
strchr.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.
v0.40: Create exercises. Challenge the community.
Meet Studio →