CString s=_T("125 12 30 " );
CString str[10];
DWORD nub = 0;
DWORD nFind = 0;
while(s.GetLength())
{
nFind = s.Find(_T(" "));
str[nub] = s.Left(nFind);
s = s.Right(s.GetLength() - nFind -1 );
s = s.TrimLeft(_T(" "));
nub++;
}
//nub 记录个数.
DWORD datanub = nub;
//数据存于str[]中
DWORD b[10] = {0};
unsigned char a[10] = {0};
for(int i = 0; i< datanub; i++ )
{
b[i] = _ttoi(str[i]);
a[i] = b[i];
}
CString str[10];
DWORD nub = 0;
DWORD nFind = 0;
while(s.GetLength())
{
nFind = s.Find(_T(" "));
str[nub] = s.Left(nFind);
s = s.Right(s.GetLength() - nFind -1 );
s = s.TrimLeft(_T(" "));
nub++;
}
//nub 记录个数.
DWORD datanub = nub;
//数据存于str[]中
DWORD b[10] = {0};
unsigned char a[10] = {0};
for(int i = 0; i< datanub; i++ )
{
b[i] = _ttoi(str[i]);
a[i] = b[i];
}