qwer123 Q qwer123 Регистрация 25 Июл 2013 Сообщения 91 Репутация 0 Спасибо 0 Монет 0 12 Сен 2016 #1 Проблема в том что у меня в Visual Studio 2012 есть ошибка код: #include #include #include using namespace std; int main () { cout<<" Welcome to the SAPER "; cout<<" "; int a[3][3]={0, 0, 0, 0, 0, 0, 0, 0, 0}; printf(" %d %d %d ", a[0][0], a[0][1], a[0][2]); printf(" %d %d %d ", a[1][0], a[1][1], a[1][2]); printf(" %d %d %d ", a[2][0], a[2][1], a[2][2]); int choice; cin>>choice; switch (choice) { case 1: system("cls"); cout<<" Welcome to the SAPER "; cout<<" "; int b[3][3]={1, 0, 0, 0, 0, 0, 0, 0, 0}; printf(" %d %d %d ", b[0][0], b[0][1], b[0][2]); printf(" %d %d %d ", b[1][0], b[1][1], b[1][2]); printf(" %d %d %d ", b[2][0], b[2][1], b[2][2]); break; case 2: cout<<"fgf"; break; } _getch(); } Ошибка: Ошибка 1error C2360: пропуск инициализации "b" из-за метки "case" КАК ИСПРАВИТЬ
Проблема в том что у меня в Visual Studio 2012 есть ошибка код: #include #include #include using namespace std; int main () { cout<<" Welcome to the SAPER "; cout<<" "; int a[3][3]={0, 0, 0, 0, 0, 0, 0, 0, 0}; printf(" %d %d %d ", a[0][0], a[0][1], a[0][2]); printf(" %d %d %d ", a[1][0], a[1][1], a[1][2]); printf(" %d %d %d ", a[2][0], a[2][1], a[2][2]); int choice; cin>>choice; switch (choice) { case 1: system("cls"); cout<<" Welcome to the SAPER "; cout<<" "; int b[3][3]={1, 0, 0, 0, 0, 0, 0, 0, 0}; printf(" %d %d %d ", b[0][0], b[0][1], b[0][2]); printf(" %d %d %d ", b[1][0], b[1][1], b[1][2]); printf(" %d %d %d ", b[2][0], b[2][1], b[2][2]); break; case 2: cout<<"fgf"; break; } _getch(); } Ошибка: Ошибка 1error C2360: пропуск инициализации "b" из-за метки "case" КАК ИСПРАВИТЬ
zoomorf46 Z zoomorf46 Регистрация 11 Сен 2013 Сообщения 78 Репутация 0 Спасибо 0 Монет 0 12 Сен 2016 #2 Вынеси int b[3][3]={1, 0, 0, 0, 0, 0, 0, 0, 0}; из case удлинитель ответа Позитивный голос 0
123456qqq 1 123456qqq Регистрация 10 Ноя 2013 Сообщения 88 Репутация 0 Спасибо 0 Монет 0 12 Сен 2016 #3 ну блин послал в никуда а где это и куда Позитивный голос 0