1、将十进制数转换为八进制:
CString str;
int num=255;
str.Format(_T("%o"),num); //str="377"
str.Format(_T("%.8o"),num); //str="00000377"
2、将十进制数转换为二进制:
while (Data > 0) {Binary[i] = Data%2; i = i + 1;Data = Data / 2; }