标签:style io ar sp on 代码 size as har
代码:
#include <stdio.h>
#include <stdlib.h>
// C语言将字符常量视为int类型而非char类型
int main(void) {
// sizeof(int) == 4
// sizeof(char) == 1
printf(sizeof(‘ABCD‘) == sizeof(int)? "True" : "False");
printf("\n");
char ch = ‘ABCD‘;
printf("%c\n", ch);
return EXIT_SUCCESS;
}
输出:
True D
标签:style io ar sp on 代码 size as har
原文地址:http://my.oschina.net/Xwoder/blog/325322