Next: , Previous: , Up: String Functions in C Locale   [Contents][Index]

13.7.6 c-strtod

The c-strtod module contains a string to number (‘double’) conversion function operating on single-byte character strings, that operates as if the locale encoding was ASCII. (The "C" locale on many systems has the locale encoding "ASCII".)

The function is:

extern double c_strtod (const char *string, char **endp);

In particular, only a period ‘.’ is accepted as decimal point, even when the current locale’s notion of decimal point is a comma ‘,’, and no characters outside the basic character set are accepted.

On platforms without strtod_l, this function is not safe for use in multi-threaded applications since it calls setlocale.