This commit is contained in:
mpabi 2024-05-26 08:07:17 +00:00
parent 7bf09994cf
commit ff66e2ef5d
1 changed files with 2 additions and 3 deletions

View File

@ -1,8 +1,7 @@
#include "myfunc.h"
#include <cstring>
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];
}