随手写的,没有经过测试,建议楼主看看msdn中cstring中的find函数CString text = _T("abcdeabcde");
CString str = _T("ab");
int start = 0;
int count = 0;
do
{
start = text.Find( str, start );
if( start == -1 )
break;
count ++;
}while( true )
CString str = _T("ab");
int start = 0;
int count = 0;
do
{
start = text.Find( str, start );
if( start == -1 )
break;
count ++;
}while( true )
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货