Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does C language output characters in "integer" mode and "character" mode?
How does C language output characters in "integer" mode and "character" mode?
As long as it is output according to the specified output format, the output format of integers is %d and the output format of characters is% c.

When the characters are output as integers, the corresponding values of the characters in the ASCII code table are output.

For example:

char ch = ' a

printf("%d %c ",ch,ch);

The output result is 97 A.

%d is output as an integer, and the number 97 corresponding to the character A in the ASCII code table is output.

Output %c by character, output character a.