10转16进制 进制转2进制

时间:2019-08-16 18:21:54   收藏:0   阅读:65

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!