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