首先构造一个以'\0'结尾的char数组 char ch[10 - 3 + 1] = {0}; 然后把by中的内容复制过来 memcpy(ch, &(by[3]), 10 - 3); 最后根据此数组构造CString CString str(ch);