Microsoft Visual 2010 Express włączanie konsoli...

0

Co mam źle w tych kodach bo jak otworze konsole to nic nie pisze dlaczego?

kod:

void Draw( int type )
{
	HANDLE uchwyt;
    uchwyt = GetStdHandle(STD_OUTPUT_HANDLE);



	Slepp(100);

	system("cls")

    switch( type )
	{
		case 1;
        cout<<"===================="<<endl;
        cout<<"    Witaj w grze    "<<endl; 
		cout<<endl;
		SetConsoleTextAttribute(uchwyt,3);
		cout<<"       THE RUN      "<<endl;
		cout<<endl;
		SetConsoleTextAttribute(uchwyt,7);
		cout<<"===================="<<endl;
		cout<<"= 1 Graj!           "<<endl;
		cout<<"= 2 Statystyki      "<<endl;
		cout<<"= 3 Opcje           "<<endl;
		cout<<"= 4 Autor           "<<endl;
		cout<<"= 0 Wyjscie         "<<endl;
		cout<<"===================="<<endl;
		break;

		case 2;
	   {
        cout<<"================================="<<endl; 
		SetConsoleTextAttribute(uchwyt,3);
		cout<<"             Statystyki          "<<endl;
		SetConsoleTextAttribute(uchwyt,7);
		cout<<"================================="<<endl;



		cout<<endl;
		cout<<"================================="<<endl;
		cout<<"Aby wrocic do menu wcisnij 0"<<endl;
        cout<<"================================="<<endl;
	   }
        break;

		case 3;
	   {
        cout<<"============================"<<endl;
		SetConsoleTextAttribute(uchwyt,3);
		cout<<"         Menu Opcji         "<<endl;
		SetConsoleTextAttribute(uchwyt,7);
		cout<<"============================"<<endl;
		cout<<"= 1 Wyczysc statystyki      "<<endl;
		cout<<"============================"<<endl;
		cout<<"Aby wrocic do menu wcisnij 0"<<endl;
		cout<<"============================"<<endl;
	   }
	    break;

		case 4;
        cout<<"============================"<<endl;
        cout<<"Autor gry: Wojciech Figat   "<<endl;
        cout<<"Kontakt z autorem:          "<<endl;
		cout<<"[email protected]             "<<endl;

		SetConsoleTextAttribute(uchwyt,3);
		cout<<"www.mafiesto4.za.pl         "<<endl;
		SetConsoleTextAttribute(uchwyt,7);

		cout<<"Youtube: Mafiesto4          "<<endl;
		cout<<"============================"<<endl;
		cout<<"Aby wrocic do menu wcisnij 0"<<endl;
		cout<<"============================"<<endl;
        break;

	    }








}



////////////////////////////////////////////////////////////////////////////
bool GameLoop() 
{
	int menu = 1;

	int klawisz = 100;

	bool redraw = 1;

	Draw(menu);

	for(;;)
	{    

		if(_kbhit())
		{
        klawisz = _getch();

		if(klawisz = '1')
            return 0;


	    }

		if(redraw)
        Draw(menu);


	}
	return 0;
}

Proszę o pomoc.

0

Na pierwszy rzut oka:

  1. źle : system("cls")
    dobrze: system("cls");

  2. źle: Slepp(100);
    dobrze: Sleep(100);

  3. w switch wszędzie masz ";" zmaiast ":"
    źle: case 1;
    dobrze: case 1:

1 użytkowników online, w tym zalogowanych: 0, gości: 1