home go links go books go opinion go gallery go projects go resumé go
about this site
archives
book reviews
"to read" list
tech books
search books
books archive
last 10 posts
quotes
cluetrain
cluetrain (mirrored)
randobracket
image auth
search engine hits
  hit history
indexer stats
user agent list
HTML (view)
  (most up-to-date)
MS Word (dl)
code examples
doesntsuck.com
doesntsuck.com

September 30, 2004

validating input with strtol   (link)

http://home.att.net/~jackklein/c/code/strtol.html
A very common question from newcomers to C and C++ programming is how to validate input. They use the standard library functions and objects like scanf() or cin which work well if the input is well-formed and within range, but fail if the input is invalid. This can be a real problem when the input is coming from a user at a keyboard and the user types something unexpected!

Posted by yargevad at September 30, 2004 02:10 PM


This weblog is licensed under a Creative Commons License.