1.1两个char类型数据相加后,转化为int类型

#include<stdio.h>
main()
{

      char a = 127;
      char i=0;
      char ai=0;
      ai= a+i; 
      printf("size short= %d\n",sizeof(short));
          printf("size short int= %d\n",sizeof(short int));
      printf("size char= %d\n",sizeof(char));
      printf("size int = %d\n",sizeof(int));  
      printf("size a+i= %d\n",sizeof(a+i));      
      printf("size ai = %d\n",sizeof(ai));            

      getchar()    ;

}

运行结果:
这里写图片描述

posted @ 2016-08-12 22:33  JY小脚丫  阅读(284)  评论(0编辑  收藏  举报