16,471
社区成员
发帖
与我相关
我的任务
分享
char* str = "符合标准:原因";
int iPos;
int iLen = strlen(str);
for(iPos = 0; iPos < iLen; iPos++)
{
if(str[iPos] == ':')
{
break;
}
}
char* str1 = new char[iPos+1];
memcpy(str1, str, iPos);
str1[iPos] = '\0';
char* str2 = new char[iLen - iPos];
memcpy(str2, str + iPos + 1, iLen - iPos);
MessageBox(str1);
MessageBox(str2);
delete[] str1;
delete[] str2;