c语言字符型赋予整型
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
char zifu1,zifu2; //声明字符1和字符2
zifu1=88; //定义字符1
zifu2=89; //定义字符2
printf("字符1为%c,字符2为%c\n",zifu1,zifu2); //输出字符1,字符2的字符型
printf("字符1为%d,字符2为%d",zifu1,zifu2); //输出字符1,字符2的整型
return 0;
}
还没有评论,来说两句吧...