一切尽在代码中,各位自己看吧。还是非常好懂的。
//分割字符串
void Split(CString strSource,CStringArray& strDest)
{
strDest.RemoveAll();
TCHAR seps[] = _T(" ");
TCHAR *token,*next_token;
token = _tcstok_s( (LPTSTR)(LPCTSTR)strSource, seps, &next_token);
while( token != NULL )
{
strDest.Add(CString(token));
token = _tcstok_s( NULL, seps, &next_token );
}
}