strtod

Converts a string to a double precision number.

double strtod (char * string, char ** endptr);

Required Header
<stdlib.h>

Return Value

This function returns the double representation of string.

Parameters

string

  The string to be converted to a double

endptr

  An optional char * pointer to record which character stopped conversion

Remarks

The strtod function converts string to a double number, where the conversion stops at the first character that is not recognisable as a number in the form:

[whitespace][sign][digits][.digits][{e | E}[sign]digits]

If endptr is not NULL then the characters position that stopped conversion is stored at that location.

Standard Library

See Also    atoi, atol, strtol, strtoll, strtoul, strtoull