How to convert a string into a numeric type?
(Top) There is one thing that you are not allowed to ignore when you convert a string into a numeric type: the 208 might fail because the string you are convertnig might not contain a valid representation of a number. If, for example, you try to convert the string “Hello” to a number, the 208 must fail. The ol’ C way (deprecated): Many people use the atoi(), atof() and the other functions from this “family”. They’re easy to use but have a major drawback: they return 0 both on failure and when converting the string “0”, thus making a consistent error detection as good as impossible.