C – atof() function

Prev     Next

  • atof() function in C language converts string data type to float data type. Syntax for atof() function is given below.

double atof (const char* string);

  • “stdlib.h” header file supports all the type casting functions in C language.

 Example program for atof() function in C:


Value of pi = 3.140000

Other inbuilt typecast functions in C programming language:

  • Typecasting functions in C language performs data type conversion from one type to another.
  • Click on each function name below for description and example programs.
Typecast function Description
atof() Converts string to float
atoi() Converts string to int
atol() Converts string to long
itoa() Converts int to string
ltoa() Converts long to string

Prev     Next

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com

Share this website !!!
Facebook Twitter Linkedin

We Support JALLIKATTU !!!
By Fresh2Refresh.com
Show Your Support as well. Thanks!