1.
int main() { char c = ‘A‘; printf("c=%c", c); }
int main() { char c = 65; printf("c=%c", c); }
这两个结果相同 都是c=A
但如果都以%d的格式输出
int main() { char c = 65; printf("c= %d", c); }
int main() { char c = ‘A‘; printf("c=%d", c); }
则结果为c= 65
但如果
int main() { char c; c = 200; printf("c=%d", c); }
则 c=-56
int main() { unsigned char c; c = 200; printf("c=%d", c); }
则c=200
原文地址:https://www.cnblogs.com/northernmashiro/p/9384310.html
时间: 2024-11-12 00:27:42