CString CSFCApp::DecToHex(int iSource)
{
CString str;
str.Format(_T("%X"), iSource);
return str;
}
void CSFCApp::DecToBin(CString strSource, CUIntArray *IntAry)
{
IntAry->RemoveAll();
if(!IsNum(strSource)) return;
int iSource = atoi(strSource);
while(iSource>=2)
{
int k = iSource%2;
iSource/=2;
IntAry->Add(k);
}
IntAry->Add(iSource);
}
原文:https://www.cnblogs.com/ShiShouTHS/p/11365185.html