So, I'm writing a pretty basic program, but I've encountered a problem: if the condition for the first If is met, the program runs smoothly. But when condition for the second if is met, it just freezes. Can someone tell me what is wrong?
do{
cin>>wybor;
if(wybor=="1"||wybor=="1vs1"||wybor=="1 vs1"||wybor=="1vs 1"||wybor=="1 vs 1"){
okk=1;
bool zgodny;
string login2;
string haslo2;
cout<<"Drugi gracz: Podaj login.";
cin>>login2;
cout<<"Drugi gracz: Podaj haslo.";
cin>>haslo2;
drugi=logowanie(login2,haslo2,zgodny);
rozgrywka.gracze.login2=login2;
rozgrywka.gracze.tryb=1;
}
if(wybor=="2"||wybor=="vsKomputer"||wybor=="vs Komputer"||wybor=="vskomputer"||wybor=="vs komputer"){
okk=1;
rozgrywka.gracze.login2="Komputer";
rozgrywka.gracze.tryb=0;
cout<<"ok.";
}
}
while (okk==0);
Aucun commentaire:
Enregistrer un commentaire