#include <stdlib.h>
|
double
atof (const char *nptr); |
It is equivalent to:
strtod(nptr, (char **)NULL);
The decimal point character is defined in the program’s locale (category LC_NUMERIC).
#include <stdlib.h> #include <stdio.h> void main( void ) { /* Test of atof */ double d = atof(" 86778E-2"); printf( "result of atof: %f\n", d ); }
Output
result of atof: 867.78
The atof function has been deprecated by strtod and its use is not preferred.
© 2005-2007 Nokia |