x

C – ltoa() function

Prev     Next

C ltoa() function:


  • 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 C ltoa() function:

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



Like it? Please Spread the word!