+ -
当前位置:首页 → 问答吧 → CString find 怎么找不出来 “/” ??

CString find 怎么找不出来 “/” ??

时间:2011-12-11

来源:互联网

C/C++ code
void CFTPDlg::OnButtonPut() 
{
    // TODO: Add your control notification handler code here
    CString str = "adb/bdc";
    int n = 0;
    while(str.Find("/", n) == -1)
    {
        ++n;
    }
    str.Format("%d", n);
    MessageBox(str);
}

如上,怎么n总是0?

作者: Lunatic_Man   发布时间: 2011-12-11

C语言转意字符 你把他换成 "//"试试看

作者: shyandsy   发布时间: 2011-12-11

你这代码想干什么啊这是

作者: shyandsy   发布时间: 2011-12-11

这样吧:

while(str.Find('\/', n) != -1)
{
  ++n;
}

作者: keith_cheung   发布时间: 2011-12-11