Another way to convert strings into values is to use the conversion functions declared in stdlib.h—ASCII to integer (atoi()) and ASCII to float (atof()). These functions take a string buffer as their function parameter and return a value of the relevant type. atoi() returns an int value while atof() returns a double value. These functions are based on more general strings to the <type> functions—strtol(), strtoll(), strtod(), strtof(), and strtold(), where l is a long integer value, ll is a long long integer value, d is double, f is a float value, and ld is a long double value.
The ato<type>() functions assume a single value is given in the input array. The strto<type>() functions have additional parameters that allow them to convert either the whole string or a smaller part of a larger string.
We don't always need the specificity or flexibility that the strto<type>...