BOOL CStringToByte(CString scrData,int lengh)
{
BYTE data[lengh] = new BYTE();
for (int i = 0;i < lengh; i++)
{
CString temp;
int slengh = 0;
temp = scrData.Mid(0,1);
slengh = scrData.GetLength();
scrData=scrData.Right(slengh-1);
data[i] =(BYTE) _tcstoul(temp,NULL,16);//字符转为16进制
}
return TRUE;
}
c++ MFC CString 字符串转BYTE数组
最新推荐文章于 2024-06-18 15:58:16 发布