Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert long integers in C language into character strings, such as long A =11111/how to say it; Convert to an array of strings.
How to convert long integers in C language into character strings, such as long A =11111/how to say it; Convert to an array of strings.
//There is a problem with using %d upstairs. If you use the upstairs method, you should use %ld, otherwise it will overflow.

1 1 1 1 1 1 1 1

Press any key to continue.

# include & ltstdio.h & gt

# include & ltstdlib.h & gt// Don't forget this header file, otherwise the ltoa function can't be used.

Master ()

{

Length a =111111;

char str[ 10]= " \ 0 ";

ltoa(a,str, 10); //The third parameter 10 stored in the string array str means 10.

printf("%s\n ",str);

}