我试图将 wstring 转换为 unsigned char。我试过_wtoc,但这不存在。
_wto 风格有转换吗?
谢谢你。
好吧,我现在这样做:
wstring sThis=L"12";
unsigned int i;
i=_wtoi(sThis.c_str());
unsigned char c=(unsigned char)i;
我这样做
wstring wsWideString
UINT uSize = wsWideString.length();
unsigned char * ptrUChar = new unsigned char[uSize+1];
memset(ptrUChar ,'\0',uSize+1);
for(UINT i=0;i<uSize;i++)
{
ptrUChar [i] = wsWideString[i];
}
//when finished
delete [] ptrUChar ;
ptrUChar = NULL;