These functions convert a character string to a double-precision, floating-point value.
The input string is a sequence of characters that can be interpreted as a numerical value of the specified type. The function stops reading the input string at the first character that it cannot recognize as part of a number. This character may be the null character ('\0' or L'\0') terminating the string.
The str argument to atof and _wtof has the following form:
[whitespace] [sign] [digits] [.digits] [ {d | D | e | E }[sign]digits]
A whitespace consists of space or tab characters, which are ignored; sign is either plus (+) or minus (–); and digits are one or more decimal digits. If no digits appear before the decimal point, at least one must appear after the decimal point. The decimal digits may be followed by an exponent, which consists of an introductory letter (d, D, e, or E) and an optionally signed decimal integer.
The versions of these functions with the _l suffix are identical except that they use the locale parameter passed in instead of the current locale.
Generic-Text Routine Mappings
TCHAR.H routine
|
_UNICODE & _MBCS not defined
|
_MBCS defined
|
_UNICODE defined
|
|---|
_tstof
|
atof
|
atof
|
_wtof
|
_ttof
|
atof
|
atof
|
_wtof
|