diff --git a/src/string/strcmp.c b/src/string/strcmp.c new file mode 100644 index 0000000..616ffd1 --- /dev/null +++ b/src/string/strcmp.c @@ -0,0 +1,10 @@ +#include + +int strcmp(const char *s1, const char *s2) +{ + size_t i = 0; + + while (s1[i] == s2[i] && s1[i] != '\0') + i++; + return s1[i] - s2[i]; +}