[C++] Loops

so in order to make it go back to the beginning i wil have to use goto even though it isn't recommended?

No, a goto is never needed. Negata just said you should use a loop for that (a for, while or do while loop, which ever suits best).
 
The goto is just fine for small programs.
However, using goto isn't the best choice for big or released programs.
 
Code:
cout << "Please enter your username and password" << endl;
    cout << "The program will hide in order to securely keep your password safe" << endl;
    cout << "DO NOT CLICK ANYTHING WHEN APPLICATION HIDES IN ORDER TO MAKE THIS WORK" << endl;
    cin >> username;
     HWND hWnd = GetConsoleWindow();
     ShowWindow( hWnd, SW_HIDE );
    cin >> password;
    system("cls");
     hWnd = GetConsoleWindow();
     ShowWindow( hWnd, SW_SHOW );
     
	if(username == "alexz003" || username == "nonoowns", password == "xxxxxxxx")
	{
                 system("cls");                 
                 MessageBox(0,"Login Correct!","Login", 0);
                 cout << "Applications or Games?" << endl;
                 cin >> choice;
                 system("cls");
                 if(choice == "Games")
				 {
                 cout << "Please type out the name of the game you wish to play:" << endl;
                 cout << "1) Redstone" << endl;
                 cout << "2) Wolfteam" << endl;
                 cout << "3) Runescape" << endl;
                 cout << "4) YourFunCo" << endl;
                 cout << "5) Conquer" << endl;
                 cout << "6) Sims" << endl;
                 cin >> gamename;
                 if (gamename == "Redstone")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\Red Stone\\Launcher.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Wolfteam")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\SoftNyx\\Wolfteam\\NyxLauncher.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Runescape")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\SwiftKit\\SwiftKit.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "YourFunCo")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\YourFunCo\\YourFunCo.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Conquer")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\Conquer 2.0\\Conquer.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Sims")
                 {
                              WinExec("C:\\Program Files\\Electronic Arts\\The Sims 3\\Game\\Bin\\Sims3Launcher.exe", SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                               }
}
}

I want it to loop back to the beginning if the username and password aren't right.
 
i ended up figuring it out
Code:
while (username != "alexz003" || username != "nonoowns", password != "xxxxxxxx")
{
cout << "Please enter your username and password" << endl;
    cout << "The program will hide in order to securely keep your password safe" << endl;
    cout << "DO NOT CLICK ANYTHING WHEN APPLICATION HIDES IN ORDER TO MAKE THIS WORK" << endl;
    cin >> username;
     HWND hWnd = GetConsoleWindow();
     ShowWindow( hWnd, SW_HIDE );
    cin >> password;
    system("cls");
     hWnd = GetConsoleWindow();
     ShowWindow( hWnd, SW_SHOW );
}    
	if(username == "alexz003" || username == "nonoowns", password == "xxxxxxxx")
	{
                 system("cls");                 
                 MessageBox(0,"Login Correct!","Login", 0);
                 cout << "Applications or Games?" << endl;
                 cin >> choice;
                 system("cls");
                 if(choice == "Games")
				 {
                 cout << "Please type out the name of the game you wish to play:" << endl;
                 cout << "1) Redstone" << endl;
                 cout << "2) Wolfteam" << endl;
                 cout << "3) Runescape" << endl;
                 cout << "4) YourFunCo" << endl;
                 cout << "5) Conquer" << endl;
                 cout << "6) Sims" << endl;
                 cin >> gamename;
                 if (gamename == "Redstone")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\Red Stone\\Launcher.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Wolfteam")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\SoftNyx\\Wolfteam\\NyxLauncher.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Runescape")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\SwiftKit\\SwiftKit.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "YourFunCo")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\YourFunCo\\YourFunCo.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Conquer")
                 {
                              system("cls");
                              WinExec("C:\\Program Files\\Conquer 2.0\\Conquer.exe",SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                              }
                              else if (gamename == "Sims")
                 {
                              WinExec("C:\\Program Files\\Electronic Arts\\The Sims 3\\Game\\Bin\\Sims3Launcher.exe", SW_SHOWNORMAL);
                              cout << "w00t" << endl;
                              system("pause");
                               }
}
}

i was putting my while loop in the wrong spot. Thanks for everyones help. Also can anyone help me with my other thread? http://forum.ragezone.com/f144/c-win32-buttons-589978/
 
Back