up: programming:c:conversions  
c programming
function atof
What links here?

Convert string to double



Parses the C string str interpreting its content as a floating point number and returns its value as a double.

The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes as many characters as possible that are valid following a syntax resembling that of floating point literals, and interprets them as a numerical value. The rest of the string after the last valid character is ignored and has no effect on the behavior of this function.

A valid floating point number for atof is formed by a succession of:

If the first sequence of non-whitespace characters in str does not form a valid floating-point number as just defined, or if no such sequence exists because either str is empty or contains only whitespace characters, no conversion is performed.

Syntax

double atof(const char *str)

Parameters



Return Value

On success, the function returns the converted floating point number as a double value. If no valid conversion could be performed, or if the correct value would cause underflow, a zero value (0.0) is returned.

If the correct value is out of the range of representable values, a positive or negative HUGE_VAL is returned.
programming - c - functions - atof
programming - C - CLOCKS_PER_SEC
MC6802 - instruction set - complement memory
programming:windows:EnableWindow
programming:DDE:IExplorer DDE Server
Time internal format
AutoCAD - Dialog Control Language (DCL) - (action_tile key action-expression)
tk:tk_frame
tk:tk widgets
AutoCAD Entity Definitions - text
programming - c - functions - atoi
programming - c - functions - itoa
programming:Excel
programming:c:strftime
AutoCAD Entity Definitions - circle
programming - C - localtime
programming:windows:Button Notification Messages
Raspberry PI - add a network printer
filename:programming - c - functions - atof
filename:programming%20%2D%20c%20%2D%20functions%20%2D%20atof
last edit:February 06 2010 13:34:04 (6145 days ago)
ct = 1796429707.000000 = December 05 2026 00:15:07
ft = 1265463244.000000 = February 06 2010 13:34:04
dt = 530966463.000000