C – ltoa() function

Prev     Next

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

char *ltoa(long N, char *str, int base);

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

Example program for ltoa() function in C:

Output:

Binary value = 100110001001011010000000
Decimal value = 10000000
Hexadecimal value = 989680

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

Continue on C – Miscellaneous functions….

Prev     Next

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

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