Cstring 截获数据 20080110 11:22 234人阅读 评论(0) 收藏

    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];
    }

版权声明:本文为博主原创文章,未经博主允许不得转载。

原文地址:https://www.cnblogs.com/deman/p/4716624.html