Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Essential Type of an Expression Clarification
#1
Suppose I have:
Code:
((unsigned short) 1u) + ((unsigned short) 2u);
The essential type of each constant, '1u' and '2u', is unsigned char and the casts make the essential type of each operand unsigned short. Now, if shorts are 16 bits wide and chars are 8 bits wide, what is the essential type of the expression; unsigned char because of the value, '3u', or unsigned short because of the operands?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)