From ff66e2ef5d519c478d6c2e302c055f459e2b5209 Mon Sep 17 00:00:00 2001 From: mpabi Date: Sun, 26 May 2024 08:07:17 +0000 Subject: [PATCH] update --- cpp/myfunc.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/myfunc.cpp b/cpp/myfunc.cpp index 7d865b6..f519d24 100644 --- a/cpp/myfunc.cpp +++ b/cpp/myfunc.cpp @@ -1,8 +1,7 @@ #include "myfunc.h" -#include -int strncmp(const char* s1, const char* s2, size_t n) { - for (size_t i = 0; i < n; i++) { +int strncmp(const char* s1, const char* s2, int n) { + for (int i = 0; i < n; i++) { if (s1[i] != s2[i]) { return (unsigned char)s1[i] - (unsigned char)s2[i]; }