réplica de
https://github.com/Arnau478/quark.git
synced 2024-11-23 12:58:07 +01:00
Implemented strcmp()
This commit is contained in:
pare
cb025a54fc
commit
704e219c6c
S'han modificat 2 arxius amb 6 adicions i 0 eliminacions
|
@ -5,3 +5,8 @@ int strlen(char *s){
|
|||
while(*(s++)) len++;
|
||||
return len;
|
||||
}
|
||||
|
||||
int strcmp(char *s1, char *s2){
|
||||
while(*s1 && (*s1 == *s2)) {s1++; s2++;}
|
||||
return *(const unsigned char *)s1 - *(const unsigned char *)s2;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
int strlen(char *s);
|
||||
int strcmp(char *s1, char *s2);
|
||||
|
|
Loading…
Referencia en una nova incidència