这是神马个情况!!!!???
程序代码:
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { TCHAR name1[20],name2[20],name3[20]; TCHAR result1[10]; TCHAR *ch; int i,j,k; switch(id) { case IDC_BTN1 : GetDlgItemText(hwnd,IDC_EDT1,name1,sizeof(name1)/sizeof(TCHAR)); i=atoi(name1); GetDlgItemText(hwnd,IDC_EDT2,name2,sizeof(name2)/sizeof(TCHAR)); ch=name2; GetDlgItemText(hwnd,IDC_EDT3,name3,sizeof(name3)/sizeof(TCHAR)); j=atoi(name3); if(*ch=='+') { k=i+j; itoa(k,result1,10); MessageBox(NULL,result1,"ANSERVER1",MB_OKCANCEL); } else if(*ch=='-') { k=i-j; itoa(k,result1,10); MessageBox(NULL,result1,"ANSERVER1",MB_OKCANCEL); } else if(*ch=='*') { k=i*j; itoa(k,result1,10); MessageBox(NULL,result1,"ANSERVER1",MB_OKCANCEL); } else if(*ch=='/') { if(j==0) { MessageBox(NULL,"ERROR","WARNING",MB_OK); } k=i/j; itoa(k,result1,10); MessageBox(NULL,result1,"ANSERVER1",MB_OKCANCEL); } break; default: MessageBox(NULL,"INPUT ERROR","WARNING",MB_OK); break; } }在执行switch的时候就直接跳到default这步了,而且点击ok,一直出现input error这个窗口,点三四次之后就会没有了,这是怎么个情况呢?????
望各位高手给讲解一下。。