if a user was to enter a letter instead of an integer, the loop goes wild.
I know how to get rid of that error
cin.clear() and cin.ignore()
but I haven't been able to understand why it happens. A character is represented by an integer from 0 to 255. And each number is 32 bit enough for the integer variable to handle..so why does the stream fail then?
Is it possible to use exception to test for this errors, I am trying to understand exceptions, and I wasn't able to write code for that..