INtime SDK Help
strtof, wcstof

Converts a string to a single-precision floating-point value.

#include <stdlib.h>

float strtof(const char *nptr, char **endptr);

#include <wchar.h>

float wcstof(const wchar_t *nptr, wchar_t **endptr);

Parameters

nptr
String to convert; a sequence of characters that can be interpreted as a numerical value of the specified type.
endptr
End of scan.

Remarks

strtof expects nptr to point to a string with this form:

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

The first character that does not fit this form stops the scan.

If no conversion can be performed (no valid digits are found or an invalid base is specified), the value of nptr is stored at the location pointed to by endptr.

Return Values

strtof returns the value of the floating-point number, except when the representation would cause an overflow, in which case the function returns +/–HUGE_VALF. The sign of HUGE_VALF matches the sign of the value that cannot be represented. strtof returns 0 if no conversion can be performed or an underflow occurs.

wcstof returns values analogously to strtof. For both functions, errno is set to ERANGE if overflow or underflow occurs.

Generic Text Routines

tchar.h routine _UNICODE not defined _UNICODE defined
_tcstof strtof wcstof

Requirements

Versions Defined in Include Link to
INtime 3.0
INtime 6.0 (wide-character and generic text versions)
intime/rt/include/stdlib.h
intime/rt/include/wchar.h
intime/rt/include/tchar.h
stdlib.h
wchar.h
tchar.h
clib.lib
See Also