This source code doesn't give compiler errors but when I type "4"Code:int fin = 0; while (fin == 0) { int choice; cout << "What do you want to do: " << endl; cout << "1. Gain strenght\n" << "2. Gain agility\n" << "3. Gain intelligence\n" << "4. Leave city\n"; cout << "Choice: "; cin >> choice; switch(choice) { case 1: cout << "You have gained 1 strength!" << endl; s++; times++; break; case 2: cout << "You have gained 1 agility!" << endl; ag++; times++; break; case 3: cout << "You took lessons! Intelligence +1!" << endl; intel++; times++; break; case 4: fin = 1; break; } }
It says critical error and the program shuts down. What is wrong?![]()



LinkBack URL
About LinkBacks



