请问CString中Find函数使用变量的有关问题
请教CString中Find函数使用变量的问题
Find函数的用法一般如下
CString s( "abcdef " );
ASSERT( s.Find( "de " ) == 3 );
现在需要Find的字串是一个变量m_temp,如
CString m_temp;
因此有了下面的语句
s.Find( m_temp );
执行时函数就没有工作,什么原因,还是有其它格式?
------解决方案--------------------
怎么可能?一定是哪里出错了.
------解决方案--------------------
看看返回值,如何知道没有工作?
------解决方案--------------------
Return Value
The zero-based index of the first character in this CString object that matches the requested substring or characters; -1 if the substring or character is not found.
看看Return Value
------解决方案--------------------
最好能贴出代码,让大家帮你分析分析
------解决方案--------------------
debug一下,看看不是不你的m_temp赋值有问题!
Find函数的用法一般如下
CString s( "abcdef " );
ASSERT( s.Find( "de " ) == 3 );
现在需要Find的字串是一个变量m_temp,如
CString m_temp;
因此有了下面的语句
s.Find( m_temp );
执行时函数就没有工作,什么原因,还是有其它格式?
------解决方案--------------------
怎么可能?一定是哪里出错了.
------解决方案--------------------
看看返回值,如何知道没有工作?
------解决方案--------------------
Return Value
The zero-based index of the first character in this CString object that matches the requested substring or characters; -1 if the substring or character is not found.
看看Return Value
------解决方案--------------------
最好能贴出代码,让大家帮你分析分析
------解决方案--------------------
debug一下,看看不是不你的m_temp赋值有问题!