Catching Bad String,Int,Char Values?
Author |
Message |
ecliptical
|
Posted: 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? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Cervantes
|
Posted: Mon Dec 19, 2005 7:41 pm Post subject: (No 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 |
|
|
|
|
|
ecliptical
|
Posted: Mon Dec 19, 2005 7:53 pm Post subject: (No subject) |
|
|
Thanks for the quick reply! works great now... |
|
|
|
|
|
|
|