#include <stdlib.h>double atof(const char *str);

The atof( ) function converts the string pointed to by str into a double value. The string must contain a valid floating-point number. If this is not the case, the returned value is undefined.

The number can be terminated by any character that cannot be part of a valid floating-point number. This includes whitespace, punctuation (other than periods), and characters other than E or e. This means that if atof( ) is called with “100.00HELLO”, the value 100.00 will be returned.

Related functions are atoi( ) and atol( ).

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: