Currently At: Programming Reference > C Reference > Standard C String & Character > atof()

atof()


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


Description:
The function atof() converts str into a double, then returns that value. str must start with a valid number, but can be terminated with any non-numerical character, other than "E" or "e".

Example:
x = atof( "42.0is_the_answer" );

RESULT: x set to 42.0


Related Topics:
atoi(), atol()


Web Standards & Support:

Link to and support eLook.org Powered by LoadedWeb Web Hosting
Valid XHTML 1.0! Valid CSS! eLook.org FireFox Extensions