add: strcmp

This commit is contained in:
starnakin 2024-09-06 23:08:48 +02:00
parent f6c6091beb
commit 53faf0936e

10
src/string/strcmp.c Normal file
View File

@ -0,0 +1,10 @@
#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];
}