Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Catching Bad String,Int,Char Values?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ecliptical




PostPosted: 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
Sponsor
sponsor
Cervantes




PostPosted: 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




PostPosted: Mon Dec 19, 2005 7:53 pm   Post subject: (No subject)

Thanks for the quick reply! works great now...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: