Definition | #include <wchar.h> double wcstod(const wchar_t *nptr, wchar_t **endptr); These functions convert the initial portion of the wide character string pointed to by nptr to a double-precision representation. The input wide character string is first decomposed into three parts:
The functions then attempt to convert the subject sequence to a floating-point number, and returns the result.
If the subject sequence has the expected form, the sequence of wide character codes starting with the first digit or the radix (whichever occurs first) is interpreted as a floating constant as defined in the C language, except that the radix is used in place of a period, and that if neither an exponent part nor a radix appears, a radix is assumed to follow the last digit in the wide character string. If the subject sequence begins with a minus sign, the value resulting from the conversion is negated. A pointer to the final wide character string is stored in the object pointed to by endptr, provided that endptr is not a null pointer. The radix is defined in the program ́s locale (category If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of nptr is stored in the object pointed to by endptr, provided that endptr is not a null pointer. | |
Return val. | Converted value if successful. | |
0 | if no conversion could be performed. | |
+/-HUGE_VAL | depending on the function type and the sign of the result, if the correct value is outside the range of representable values. | |
Notes | This version of the C runtime system only supports 1-byte characters as wide character codes. Since 0 is returned on error and is also a valid return value on success, an application wishing to check for error situations should perform the following actions: set | |
See also | iswspace, localeconv, scanf, setlocale, strtod, wcstol |