| [SOLVED] C++ program help? Just a quick question, and I am embarrassed to even have to ask because it sounds so simple. I am finishing my homework and i am almost done, but i am stuck.
See, I am doing throw/catch problems, and i have all I need EXCEPT one thing. I forgot how to check to see if the input is the type of the variable, such as int.
Right now, I need a throw statement for if the number entered in an int variable is only an int, not a char or string or anything else.
I am embarrassed not to know this, but please, how do I check to see if a variable the user inputs is indeed the correct type?
basically I am asking the user to type in an integer for Feet, and part of the homework (that I already have typed up) is to create a throw/catch statement if the user inputs anything but an integer, such as a C or a &, and the condition for the throw would be if what is input is not an integer then catch and ask them to put it in again.
I just need to know how to make it so the program checks to see if it is an integer that was typed in and if not throw/catch it. |