字符串函数stricmp,strcmpi
来源:互联网 发布:大数据软件平台公司 编辑:程序博客网 时间:2024/05/17 01:06
原型:extern int stricmp(char *s1,char * s2);
用法:#include <string.h>
功能:比较字符串s1和s2,但不区分字母的大小写。
说明:strcmpi是到stricmp的宏定义,实际未提供此函数。
当s1<s2时,返回值<0
当s1=s2时,返回值=0
当s1>s2时,返回值>0
举例:
// stricmp.c
#include <syslib.h>
#include <string.h>
main()
{
char *s1="Hello, Programmers!";
char *s2="Hello, programmers!";
int r;
clrscr();
r=stricmp(s1,s2);
if(!r)
printf("s1 and s2 are identical");
else
if(r<0)
printf("s1 less than s2");
else
printf("s1 greater than s2");
getchar();
return 0;
}
相关函数:bcmp,strcmp,stricmp
(摘自 http://www.ggv.com.cn/forum/clib/string/strstr.html)
用法:#include <string.h>
功能:比较字符串s1和s2,但不区分字母的大小写。
说明:strcmpi是到stricmp的宏定义,实际未提供此函数。
当s1<s2时,返回值<0
当s1=s2时,返回值=0
当s1>s2时,返回值>0
举例:
// stricmp.c
#include <syslib.h>
#include <string.h>
main()
{
char *s1="Hello, Programmers!";
char *s2="Hello, programmers!";
int r;
clrscr();
r=stricmp(s1,s2);
if(!r)
printf("s1 and s2 are identical");
else
if(r<0)
printf("s1 less than s2");
else
printf("s1 greater than s2");
getchar();
return 0;
}
相关函数:bcmp,strcmp,stricmp
(摘自 http://www.ggv.com.cn/forum/clib/string/strstr.html)
- 字符串函数stricmp,strcmpi
- 【字符串比较函数】strcmp,stricmp,strcmpi区别
- strcmpi,stricmp函数
- strcmpi,stricmp函数
- strcmp函数 strncmp函数 strcmpi,stricmp函数
- strcmp,stricmp,strcmpi的区别
- strcmp和stricmp、strcmpi三…
- 系统函数C字符串的实现(14):strcmpi
- strcmp,stricmp,strcmpi,strncmp,strnicmp,strncmpi,strcat,strncat比较
- 用 if 提 msg[] 使用 strcmp , stricmp 例子 // + strcmpi
- strcmp strcmpi 比较字符串 matlab
- strcmpi
- strcmpi
- strcmp和stricmp、strcmpi三者之间的区别(C++)
- C++ strIcmp 字符串大小比较
- stricmp()
- strcmp()与strcmpi()函数 - C语言
- vs2013中在使用stricmp函数时出现错误
- sql server权限和数据类型
- 11
- 字符串函数strcat
- 字符串函数strchr
- 字符串函数strcmp
- 字符串函数stricmp,strcmpi
- CSS控制字体效果的思考
- 字符串函数strlen
- 微软开放了Office的二进制格式
- 字符串函数strlwr
- [实时更新]草木瓜BLOG发表的全部文章
- 字符串函数strncat
- 字符串函数strncat
- 字符串函数strncmp