+91 9945200008     support@uttaracomputers.com
LOGIN     REGISTER    

How unsigned char is smaller than char.?

0
0

Sir, unsigned char +200 is not part of 2s compliment signed char. Then how you arrived at unsigned char is smaller than signed char for AUTOCASTING.

  • You must to post comments
0
0

There is no question of bigger or smaller in auto casting.  It is only a question of which data gets casted because of association.  If a char and an int are associated (because of assignment or comparison or arithmetic operation, etc.) then the char is cast as an int since int is treated as the higher data type.  If you try

Sizeof(int) > -1

it will be treated as FALSE !!  since sizeof operator produces an unsigned number and unsigned int is treated as higher type than int.  Hence the compiler will cast the -1 as unsigned int  which results in all binary 1’s OR the biggest unsigned integer.

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.