描述:
#include <string.h>
int addSegWord(char *strWord , int len)
{
char firstChar,lastChar;
SEG_NODE* curLst;
SEG_NODE* newWord ,*curTmp ;
firstChar = strWord[0] ;
lastChar = strWord[len-1];
//查看是否已经存在
firstChar %= MAX_CDIM ;
lastChar %= MAX_CDIM ;
curLst = SEG_LIST[firstChar][lastChar].lstWord;
curTmp = curLst ;
while(curTmp != NULL )
{
if ( strcasecmp(curTmp->strWord,(char *)strWord) == 0)
return 0; //已经存在
curTmp = curTmp->nextWord;
}
newWord = (SEG_NODE*)malloc(sizeof(SEG_NODE));
if ( newWord == NULL)
return -1;
strcpy(newWord->strWord,(char *)strWord);
newWord->nextWord = NULL;
if( curLst == NULL) //reinit list;
{
SEG_LIST[firstChar][lastChar].lstWord = newWord ;
return 0;
}
curTmp = curLst ;
while(curTmp -> nextWord != NULL )
{
curTmp = curTmp->nextWord;
}
curTmp -> nextWord = newWord ;
return 0;
}
--------------------Configuration: logionsplit - Win32 Debug--------------------
Compiling...
split_ATL.cpp
F:\代码\c++\logionsplit\split_ATL.cpp(154) : error C2065: 'strcasecmp' : undeclared identifier
执行 cl.exe 时出错.
logionsplit.dll - 1 error(s), 0 warning(s)
这样的代码,我没写ATL,直接在DEV里用成常,而且我发现unsigned char *strWord
VC++6.0 atl一定报错
希望谁可以帮我解释下,我刚学VC++
解决方案1:
我在string.h里没找到strcasecmp