
Implement gm_strncmp, your own strncmp, which compares two null-terminated strings, but never looks at more than the first n bytes.
gm_strncmp("ab", "abc", 2)Expected result
0For your own tracking. Tests grade your code.
gm_strncmp("ab", "abc", 3)Expected result
negative valueExpected files
strncmp.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_strncmp, your own strncmp, which compares two null-terminated strings, but never looks at more than the first n bytes.
gm_strncmp("ab", "abc", 2)Expected result
0For your own tracking. Tests grade your code.
gm_strncmp("ab", "abc", 3)Expected result
negative valueExpected files
strncmp.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.