十进制转换成二、八 十六进制
十进制转换成二、八 十六进制:
十进制转换成二进制.rar
(2.16 KB)
程序代码:
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { switch(id) { case IDC_TWO: { TCHAR Number1[256]; GetDlgItemText(hwnd,IDC_EDIT1,Number1,sizeof(Number1)); int num=atoi(Number1); TCHAR Number2[256]; itoa(num,Number2,2); SetDlgItemText(hwnd,IDC_EDIT2,Number2); }break; case IDC_EIGHT: { TCHAR Number1[256]; GetDlgItemText(hwnd,IDC_EDIT1,Number1,sizeof(Number1)); int num=atoi(Number1); TCHAR Number2[256]; itoa(num,Number2,8); SetDlgItemText(hwnd,IDC_EDIT3,Number2); }break; case IDC_SIXTH: { TCHAR Number1[256]; GetDlgItemText(hwnd,IDC_EDIT1,Number1,sizeof(Number1)); int num=atoi(Number1); TCHAR Number2[256]; itoa(num,Number2,16); SetDlgItemText(hwnd,IDC_EDIT4,Number2); }break; default: break; } }