Jak zrobić żeby od "Zmienic nick tak/nie" wracało mi do wyboru nicku ? Chodzi mi o to jak zrobić tą pętle bo coś mi nie idzie ;/
#include <iostream>
#include <cstdlib>
using namespace std;
#include <cstdlib>
string nick,klasa,wybor,styl,znick ;
int main()
{
do
{
cout << "Witaj w grze rpg v2" ;
cout <<endl ;
cout <<endl ;
cout << "1 litera musi byc duza!"<<endl ;
cout <<"Wojownik" <<endl ;
cout << "Mag" <<endl ;
cout << "Lucznik" <<endl ;
cout <<endl ;
cout << "Wybierz klase:" ;
cin >> klasa ;
if (klasa=="Wojownik")
{
cout <<endl ;
cout << "Wybrales wojownika" <<endl ;
}
else if (klasa=="Mag")
{
cout <<endl ;
cout << "Wybrales maga" <<endl ;
}
else if (klasa=="Lucznik")
{
cout <<endl ;
cout << "Wybrales lucznika" <<endl ;
}
else
{
cout <<endl ;
cout << "Panie,nie ma takiej klasy!" <<endl ;
exit( 0 );
}
cout << "Podaj nick:" ;
cin.clear();
cin.sync();
getline(cin, nick) ;
cout <<endl ;
if (nick=="")
{
cout << "Musisz podac jakis nick!"<<endl ;
exit( 0 );
}
else
{
cout << "Nazywasz sie:" <<nick ;
cout << endl ;
cout << endl ;
cout << "Styl [szybki] z malymi obrazeniami" <<endl ;
cout << "Styl [wolny] z duzymi obrazeniami" <<endl ;
cout << "Wybierz swoj styl:" ;
cin >> styl ;
{
cout << "Zmienic nick tak/nie:" ;
cin >> znick ; //tutaj petla do "podaj nick"
cout <<endl ;
cout << "Chcesz wrocic do poczatku tak/nie:" ;
cin >> wybor ;
system ("cls") ;
}
}
}
while (wybor=="tak") ;
return 0;
}