CString转化成char型阿
这是一个组合框的一个消息函数 我想实现的功能是 输入的字符串后,在我已经建好的链表里查找是否有这个字符串!
void CDictionaryDlg::OnEditchangeInputCombo()
{
UpdateData(TRUE);
CString Value;
Value = m_input;
WORDNODE *result;
result = lookup(p, Value);
}
我得问题就是这个value是CString型 而我得链表里储存的都是char型 这两个怎么比较阿?
怎么把CString转化成char型阿!或者是怎么样实现这个功能!?
谢谢大家!
查找函数的原型
WORDNODE *lookup(WORDNODE *listp, char *word)
{
for (; listp != NULL; listp = listp->next)
{
if (strcmp(word, listp->word)==0)
{
return listp;
}
}
return NULL;
}
这个是结构体
struct WORDNODE
{
char *word;
char *mean;
char *anoun;
int rec;
WORDNODE *next;
};