ИТ
Иван Тучин
Switch() останавливает while() в C++
Кусок программы :
while(g == 1)
{
if (!_kbhit())
{
SetConsoleCursorPosition(hOut,c);
printf(" ");
c.X += 1;
c.Y += 1;
SetConsoleCursorPosition(hOut,c);
cout
Кусок программы :
while(g == 1)
{
if (!_kbhit())
{
SetConsoleCursorPosition(hOut,c);
printf(" ");
c.X += 1;
c.Y += 1;
SetConsoleCursorPosition(hOut,c);
cout
Элементарно, использовать _getch только когда сработало _kbhit
То есть вместо
Sleep(70);
}
switch(_getch())
написать
Sleep(70);
}
else
switch(_getch())