#include <stdlib.h>double strtod(const char *start, char **end);
The strtod( ) function converts the string representation of a number stored in the string pointed to by start into a double and returns the result.
In C99, start and end are qualified by restrict.
The strtod( ) function works as follows. First, any whitespace in the string pointed to by start is stripped. Next, each character that comprises the number is read. Any character that cannot be part of a floating-point number will cause this process to stop. This includes whitespace, punctuation (other than periods), and characters other than E or e. Finally, end is set to point to the remainder, if any, of the original string. This means that if strtod( ) is called with “100.00 Pliers”, the value 100.00 will be returned and end will point to the space that precedes “Pliers”.
If overflow occurs, either HUGE_VAL or –HUGE_VAL (indicating positive or negative overflow) is returned, and the global variable errno is set to ERANGE, indicating a range error. If underflow occurs, the function returns zero and the global variable errno is set to ERANGE. If start does not point to a number, no conversion takes place and zero is returned.
Related functions are atof( ), strtold( ), and strtof( ).