| 2 | #define _STRING_C |
| 3 | |
| 4 | int strcmp(const char* s1, const char* s2) { |
| 5 | while (*s1 && *s2 && *s1 == *s2) { |
| 6 | s1++; |
| 7 | s2++; |
| 8 | } |
| 9 | // Return the difference between the current characters pointed to by s1 and s2 |
| 10 | // This correctly handles the case where one string might be shorter than the other |
| 11 | return (unsigned char)*s1 - (unsigned char)*s2; |
| 12 | } |
| 13 | |
| 14 | unsigned long strlen(const char* str) { |
| 15 | unsigned long len = 0; |