42_KFS_LIB/src/string/strcmp.c

11 lines
155 B
C
Raw Normal View History

2024-09-06 17:08:48 -04:00
#include <stddef.h>
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];
}