c字符输出

#include<stdio.h>
int main() {
    char c1,c2;
    c1 = 97;
    c2 = 98;
    printf("c1 = %c,c2 = %c
",c1,c2);// ASCII码的值在0 ~ 127之间,而c1、c2都大于127,所以没有对应的字符
    printf("c1 = %d,c2 = %d
",c1,c2);
printf("c1 = %c,c2 = %c
",97,98);// 
    return 0;
}

c语言字符输出结果

1 c1 = a,c2 = b
2 c1 = 97,c2 = 98
3 c1 = a,c2 = b
原文地址:https://www.cnblogs.com/fickleness/p/3331592.html