//将字符串类型的十六进制字符 转换成 unsigned int 类型的数字
CString tmp(_T("234DF"));
int nLength = tmp.GetLength();int nBytes = WideCharToMultiByte(CP_ACP,0,tmp,nLength,NULL,0,NULL,NULL);
char* VoicePath = new char[ nBytes + 1];
memset(VoicePath,0,nLength + 1);
WideCharToMultiByte(CP_OEMCP, 0, tmp, nLength, VoicePath, nBytes, NULL, NULL);
VoicePath[nBytes] = 0;
sscanf(VoicePath,"%x",&TempDataFrame);
delete [] VoicePath;

本文详细介绍了如何将字符串形式的十六进制字符转换为unsigned int类型的数字,通过使用C++中的stringstream和scanf函数完成这一过程,并在代码中展示了具体实现步骤。
&spm=1001.2101.3001.5002&articleId=29203587&d=1&t=3&u=a56472ca74cb42b3ba6d0745495600ce)
723

被折叠的 条评论
为什么被折叠?



