[Previous]
[Contents]
[Next]

atof()

convert a string to a double representation

Synopsis:

#include <stdlib.h>

double atof( const char *ptr );

Description:

The atof() function converts the string pointed to by ptr to double representation. It's equivalent to

strtod( ptr, (char **)NULL )

Returns:

When an error has occurred, errno contains a value indicating the type of error that has been detected.

Examples:

#include <stdlib.h>

void main()
  {
    double x;

    x = atof( "3.1415926" );
  }

Classification:

ANSI

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno, sscanf(), strtod()


[Previous]
[Contents]
[Next]