Code:case IDC_TEST: std::string dicestring; dicestring = Randomdice(); SetDlgItemText(hwndDlg, IDC_NUMBER, dicestring.c_str()); break; case IDC_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break;
When i compile i am told that "initialization of 'dicestring' is skipped by 'case' label"
Now the thing to do here would be to simply move this bit :
dicestring = Randomdice();
out of the case/switch...but I am just wondering why i cant have it within?
I Hope you understand what I mean
note - I am new to makeing win applications!