strnicmp.c

来自「一个类似windows」· C语言 代码 · 共 20 行

C
20
字号
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <precomp.h>

/*
 * @implemented
 */
int _strnicmp(const char *s1, const char *s2, size_t n)
{

  if (n == 0)
    return 0;
  do {
    if (toupper(*s1) != toupper(*s2++))
      return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)--s2);
    if (*s1++ == 0)
      break;
  } while (--n != 0);
  return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?