vc中 'strcasecmp' : undeclared identifier
来源:互联网 发布:上网行为监管软件 编辑:程序博客网 时间:2024/05/16 10:06
编译源代码,vc中经常会出现: 'strcasecmp' : undeclared identifier
在vc的string.h中没有包含此函数:自己写个头文件把最下面的代码加进去即可~~~
strcasecmp()函数的作用是:对两个字符串进行比较。该函数将返回下列值:0 —— 如果字符串相等
<0 —— 如果string1小于string2
>0 —— 如果string1大于string2
其代码可以写为:
/////////////////////////////////////////////////////////////////////////////////////////
int strcasecmp(char *s1, char *s2)
{
while (toupper((unsigned char)*s1) == toupper((unsigned char)*s2++))
if (*s1++ == '\0')
return 0;
return(toupper((unsigned char)*s1) - toupper((unsigned char)*--s2));
}
转载自http://hi.baidu.com/dwj192/item/70044e09b5ab7925a1312d5c
0 0
- vc中 'strcasecmp' : undeclared identifier
- [VC] error C2065: 'M_PI' : undeclared identifier
- VC++错误:error C2065: 'SHCreateDirectoryEx' : undeclared identifier
- VC中使用高版本API的方法——undeclared identifier引发的问题
- VC中使用高版本API的方法——undeclared identifier引发的血案
- VC++中出现错误“ error c2065 'printf' undeclared identifier”的处理方法
- VC中使用高版本API的方法——undeclared identifier引发的血案
- vc多线程编程 error C2065: '_beginthread' : undeclared identifier
- vc++6.0 编译报错 error C2065: '' : undeclared identifier
- error:VC编译错误:error C2065: '_beginthreadex' : undeclared identifier
- 解决VC++6.0 error C2065: 'ODS_HOTLIGHT' : undeclared identifier问题
- 结构体中经常碰到的一个错误 undeclared identifier
- stm32 keil中出现use of undeclared identifier' '的原因
- 提示“_beginthread“ undeclared identifier
- _beginthreadex : undeclared identifier解决办法
- C2065:'_beginthreadex' undeclared identifier
- 'CoInitializeEx' : undeclared identifier
- 'CoInitializeEx' : undeclared identifier 问题
- LeetCode------42. Trapping Rain Water(捕获雨水量)
- 观察者 (广播消息)
- 第一个.bat批量文件的写法(文件打开和文件下载)
- js中splice()的强大(插入、删除或替换数组的元素)
- 初始创建springmvc_mybatis1208控制台报错
- vc中 'strcasecmp' : undeclared identifier
- mysql主从复制
- webpack gulp 实现完整前端工程化
- 仿 boss 直聘,查看用户头像
- 线程冲突与解决
- Log4J日志配置详解
- 闭包的理解
- bootstrap的内置按钮样式
- C++,java,Python的内部实现sort怎么实现的,有什么不同?