I am working with a console app using c++, and I'm using integers for the data type. I would like to know how to trap an error if the user enters an alpha character instead. I have tried using the if statment below, but the program goes crazy anyway. Does anyone know a way to trap this type of potential error?
TIA, Tetsuya
if(isdigit(input))
code....
TIA, Tetsuya
if(isdigit(input))
code....