16,470
社区成员
发帖
与我相关
我的任务
分享
//前面的代码贴错地方了,-_-#
TCHAR aaa[] = "abc\0def\0ghij\0\0";
CString str;
for(int i = 0; i < 3; i++)
{
AfxExtractSubString(str,aaa,0,'\0');
strcpy(bbb[i], str.GetBuffer(0));
str.ReleaseBuffer(0);
}
LPCSTR sFileName ="F:\\1\\0\\20081126\\106\\2042410.V3";
char *pdest;
int result1 = 0, result2 = 0;;
for(int i = 0; i < 4; i++)
{
pdest = strchr( sFileName + result1, '\\' );
result1 = (int)(pdest - sFileName + 1);
}
pdest = strchr( sFileName + result1, '\\' );
result2 = (int)(pdest - sFileName + 1);
char *ch;
ch = new char[result2 - result1];
memcpy(ch, sFileName + result1, sizeof(ch));
ch[result2 - result1 - 1] = 0;
int j = atoi(ch);
delete []ch;
TCHAR aaa[1024],*p
TCHAR bbb[1024]
memcpy(aaa ,_T("abc\0def\0ghij\0\0"));
p = &aaa[0];
while (TRUE)
{
memcpy(bbb,p);
p+=wcslen(p)+1;
if (memcmp(p, _T("\0\0"),2)==0)
{
break;
}
}