I don't know if you can change the behaviour somehow but normally when you read a char from std::cin you read a character and not a number. Can't you make width an int instead?
Oh god am I dumb... it is NOT a char, the variable width is an integer. The reason I posted this question is because it crashes whenever anything besides an integer is entered. I was trying to find a way to sterilize user input so that if they enter "octopus23" it gives an error as opposed to crashing while I am collecting the variable width.
When I said it works for letters, I meant that it successfully gives an error message when letters are inputted. However, I still get an error if letter/number combo's are inputted.