I am writing a program where you pick a number between 1 and 100. In this program i choose what the winning number is. I have it working when the user enters a number but when they enter a letter it crashes how do i fix this thanks
int number ;
while( !( std::cout << "please enter a number: " && std::cin >> std::ws >> number ) )
{
std::cin.clear() ;
std::cin.ignore( 1000, '\n' ) ;
}
// use number