这是一个组合框的一个消息函数 我想实现的功能是 输入的字符串后,在我已经建好的链表里查找是否有这个字符串!
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;
};
解决方案 »
- 关于SDI菜单栏的问题我用的CGfxOutBarCtrl
- 父进程等待子进程结束的问题
- 再问大家一个问题?关于应用程序向导的?谢谢
- 如何重载MDI里面每个Document的关闭按钮的方法,就是右上角的‘叉’
- 又是HtmlView的问题,这回是要去掉边框
- sock 编程问题
- 基于MFC的对话框程序如何用GIF图片作背景?
- 那位 讲一下得分快一点哦? 谢谢大家了~~~~~~
- ·#·#·#如何使formview的 滚动条 在任何时候都不可见?例如 在改变窗口的时候 谢谢!
- 关于CEditView 中的style
- CStdio支持Unicode下中文吗?
- InvokeHelper()函数是干什么的,各参数什么意思
char s[20];1)CString ---> char *;strcpy(s, s1.GetBuffer(0));2) char * --->CString
s1.Format("%s", s);
int nMinBufLength ); 使用这个函数可以将CString类型的转化为char数组,而后你可以自己做了
CString str;
int nLength=str.GetLength();
char * sz=new char[nLength];
sz=str.GetBuffer(0);