Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Integers are converted into strings. For example, I want to convert int 20005 into char“20005 ". How to write a program?
Integers are converted into strings. For example, I want to convert int 20005 into char“20005 ". How to write a program?
Function name: itoa

Function: Converts an integer to a string.

Usage: char * itoa (int value, char * string, int root);

Program example:

# include & ltstdlib.h & gt

# include & ltstdio.h & gt

int main(void)

{

Int number =12345;

char string[25];

Itoa (number, string,10);

Printf( "integer = %d string = %s\n ",number, string);

Returns 0;

}