可以通过字符常量为char类型的变量指定初始值。字符常量是在单引号之间写入的字符。看看下面的例子:
char
#include <stdio.h> int main(void) { char letter = 'A'; char digit = '9'; char exclamation = '!'; printf("The character is %c\n", exclamation); return 0; }