摘要:
printf("unsigned short=%d \n",sizeof(unsigned short));printf("short=%d \n",sizeof( short));printf("int=%d \n",sizeof( int));printf("char=%d \n",sizeof( char));printf("unsigned char=%d \n",sizeof(unsigned char));printf("float=%d \n",sizeof( 阅读全文
摘要:
看到一个题目:unsigned char i,j;for(i=0,j=2;i!=j;i+=5,j+=7){ printf("i=%d , j=%d \n",i,j);}unsigned char范围是0-255,在此范围内一轮循环两个值i与j不可能相等,但是在后面可能会相同,但是比如 i=253,这时候i+5=258>255此时i到底是多少?运行后知道:j=250 ,j=1; j=253, j=4; j=254, j=5; i=254, i=3; i=255, i=4;一目了然了,注意255完了之后有个0.稍作修改,把unsigned char 改为char,char 阅读全文