zoukankan      html  css  js  c++  java
  • windows API 第八篇 _tcsicmp _stricmp _wcsicmp _mbsicmp

    这些函数都是比较字符串小写的,忽略大写,出入的字符串都将按照小写比较
    Perform a lowercase comparison of strings.

    函数原型:

    int _stricmp( const char *string1, const char *string2 );        //#include <string.h>

    int _wcsicmp( const wchar_t *string1, const wchar_t *string2 );    //#include <string.h> or  <wchar.h>

    int _mbsicmp( const unsigned char *string1, const unsigned char_t *string2 );    //#include <mbstring.h>

    返回值:

    0: string1 identical to string2         <0:string1 less than  string2             >0:string1 greater than string2

    举例:
    char *str1 = "abc";
    char *str2 = "AbC";
    int  nResult = _stricmp(str1, str2);         //nResult = 0

    wchar_t szStr1[] = "asdfg";
    wchar_t szStr2[] = "AsDfG";
    int nResult = _wcsicmp(szStr1, szStr2);      //nResult = 0

    至于_mbsicmp是比较无符号字符串的,可根据情况自行使用
  • 相关阅读:
    读 《异类》- 作者:[加拿大] 马尔科姆·格拉德威尔 有感
    docker常用操作命令
    MySQL 使用规范
    js 字符串转json对象
    Mybatis 工作原理
    JDBC连接配置
    Java 线程基础
    数组与链表
    Java 内部类
    MySQL 去重
  • 原文地址:https://www.cnblogs.com/priarieNew/p/9754168.html
Copyright © 2011-2022 走看看