Atof() – C library function Program


Declaration :

Explanation :

Purpose The C library function double atof(const char *str) converts the string argument str to a floating-point number (type double).
Parameters str ===> This is the string having the representation of a floating-point number.
Return Value This function returns the converted floating point number as a double value. If no valid conversion could be performed it returns zero (0.0).
Exception

C Program : Example

The following example shows the usage of atof() function.