Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - In C language, the input integer needs to be converted into a string. What do you mean?
In C language, the input integer needs to be converted into a string. What do you mean?
Putchar(n% 10+'0'), n% 10 is an integer. But an integer plus a 0 character like' 0' will program a character! For example: 1+'0'=' 1'. That's it.

The answer is the same on the surface. But the essence is completely different, and the output after conversion is already a string. In reality, however, it looks the same. It's not an integer, but a string. The content of a string contains integers, letters, etc.

Just read more C code. See what others write. If you are not sure, follow the procedure step by step and print it out in real time to see the results.