
Implement gm_memcmp, your own memcmp, which compares the first n bytes of two memory blocks and returns an integer whose sign reflects which block is larger.
gm_memcmp("docker", "docker", 6)Expected result
0For your own tracking. Tests grade your code.
gm_memcmp("git push", "git pull", 8)Expected result
positive valuegm_memcmp("ab\0cd", "ab\0ce", 5)Expected result
negative valueExpected files
memcmp.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_memcmp, your own memcmp, which compares the first n bytes of two memory blocks and returns an integer whose sign reflects which block is larger.
gm_memcmp("docker", "docker", 6)Expected result
0For your own tracking. Tests grade your code.
gm_memcmp("git push", "git pull", 8)Expected result
positive valuegm_memcmp("ab\0cd", "ab\0ce", 5)Expected result
negative valueExpected files
memcmp.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 →