Posted on 2010-06-08 14:41
Richmond 阅读(108)
评论(0) 编辑 收藏 引用
将整形,转化成字符串,已4位为一轮 32位应该是8位:
int step = 0;
DWORD dwKey = 0xF0000000;
DWORD dwResult = 0;
while (1)
{
dwResult = (m_dwTempSerialNo & dwKey) >> (28-4*step);
serial[step] = (char)dwResult;
step++;
if (step == 8)
{
break;
}
dwKey = dwKey >> 4;
}
m_dwTempSerialNo = 0;
上面是白痴的方法,白痴啊白痴,简单的在这:
sprintf(serial, "%d", m_dwTempSerianNo);