vc++获取值的问题
void CharConvert(CString str){char name[65]={0};
UCHAR write[65]={0};
char *pStr = (LPSTR)(LPCTSTR)str; //转换为字符数组
strcpy((char*)name, pStr);
const char *d = " "; //字符拆分
char *p;
p =strtok(name,d);
int temp = 0;
while(p)
{
write[temp] =(unsigned char)p;
p=strtok(NULL,d);
temp++;
}
UCHAR ch[65] = {0};
for(int i =0;i<65;i++){//调试下看write是否有值
ch[i]=write[i];
}
WriteDatBuf[65] = write[65];
}
为什么write[65]没有值????
Visual C++ 调试 --------------------编程问答-------------------- str的格式是:00 11 22 33 44 55这样的 --------------------编程问答-------------------- 可以直接使用CString本身的find、mid的功能实现trim;
--------------------编程问答-------------------- 用一种语言,至少要知道这个语言的基本规则,比如这一句
void CharConvert(CString str)
{
CString newStr;
int iCurPos = 0, iNextPos=0;
while(iNextPos != -1)
{
iNextPos = str.Find(" ", iCurPos);
if (iNextPos != -1)
{
newStr += str.Mid(iCurPos, iNextPos-iCurPos);
}
else
{
newStr += str.Mid(iCurPos);
}
iCurPos = iNextPos+1;
}
strcpy(WriteDatBuf, newStr);
}
write[temp] =(unsigned char)p;
你要到达什么目的,这段语句是怎么执行的?
补充:.NET技术 , VC.NET