mardi 30 juin 2015

Range of unsigned char in C language


As per my knowledge range of unsigned char in C is 0-255. but when I executed the below code its printing the 256 as output. How this is possible? I have got this code from "test your C skill" book which say char size is one byte.

main()
{
 unsigned char i = 0x80;
 printf("\n %d",i << 1);
} 


Aucun commentaire:

Enregistrer un commentaire