If i the input is not an int, it's going to give a infinite loop, i think it skips the second cin, but i don't know how to fix it.
cout << "Number of days : "; int days; cin >> days; while(!cin){ cout << "Invalid"; cin >> days; }
Aucun commentaire:
Enregistrer un commentaire