x

C – itoa () function

Prev     Next

C itoa () function:


  • itoa () function in C language converts int data type to string data type. Syntax for this function is given below.

char *  itoa ( int value, char * str, int base );


  • “stdlib.h” header file supports all the type casting functions in C language. But, it is a non standard function.

Example program for C itoa () function:

itoa () function Output:

Binary value = 1101010000110101
Decimal value = 54325
Hexadecimal value = D435

Other inbuilt typecast functions in C programming language:

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

atof()

atof( ) function converts string to float

atoi()

atoi( ) function converts string to int

atol()

atol( ) function converts string to long

itoa()

itoa( ) function converts int to string

ltoa()

ltoa( ) function converts long to string

Prev     Next



Like it? Please Spread the word!