
Implement gm_strstr, your own strstr, which searches a string for the first occurrence of a substring and returns a pointer to where it begins.
gm_strstr("git rebase main", "rebase")Expected result
rebase mainFor your own tracking. Tests grade your code.
gm_strstr("merge conflict", "xyz")Expected result
(null)gm_strstr("commit", "")Expected result
commitgm_strstr("aaab", "aab")Expected result
aabExpected files
strstr.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_strstr, your own strstr, which searches a string for the first occurrence of a substring and returns a pointer to where it begins.
gm_strstr("git rebase main", "rebase")Expected result
rebase mainFor your own tracking. Tests grade your code.
gm_strstr("merge conflict", "xyz")Expected result
(null)gm_strstr("commit", "")Expected result
commitgm_strstr("aaab", "aab")Expected result
aabExpected files
strstr.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.