
Implement gm_memchr, your own memchr, which scans the first n bytes of a memory area for a given byte and returns a pointer to the first match, or NULL if it is absent.
byte index of gm_memchr("docker", 'r', 6)Expected result
5For your own tracking. Tests grade your code.
gm_memchr("zsh prompt", 'X', 10)Expected result
nullExpected files
memchr.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_memchr, your own memchr, which scans the first n bytes of a memory area for a given byte and returns a pointer to the first match, or NULL if it is absent.
byte index of gm_memchr("docker", 'r', 6)Expected result
5For your own tracking. Tests grade your code.
gm_memchr("zsh prompt", 'X', 10)Expected result
nullExpected files
memchr.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.