Computer Science Canada Catching Bad String,Int,Char Values? |
Author: | ecliptical [ Mon Dec 19, 2005 7:39 pm ] |
Post subject: | Catching Bad String,Int,Char Values? |
I'm writing a program that is supposed to collect int's however it also runs into strings and characters...how can I catch/handle these without crashing the interger function? |
Author: | Cervantes [ Mon Dec 19, 2005 7:41 pm ] |
Post subject: | |
strintok Get input from the user as a string, then use that to test if you can turn it into an int. If you can, turn it into an int with strint |
Author: | ecliptical [ Mon Dec 19, 2005 7:53 pm ] |
Post subject: | |
Thanks for the quick reply! works great now... |