Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the function of converting integer variables into strings in C language?
What is the function of converting integer variables into strings in C language?
International value; //Integer

char SZ[ 10]; //String

sprintf(sz,“%d”,iValue); //This sentence requires a header file # include.

/* or */

itoa(iValue,sz, 10); //This sentence requires a header file # include.

Sprintf is similar to printf. Printf has one less parameter than sprintf, that is, it outputs the corresponding thing directly on the output interface, while sprintf stores what you want to output in the string of the first parameter according to the corresponding format.

Itoa directly converts integers into strings.