I have a basic C question.
Suppose I\'ve declared and initialized a standard 16 bit unsigned integer
uint16_t var1 = 0x1234;
and then s
Yes. The compiler would internally interpret this as
var2 = (uint8_t)var1;
which would result in var2 having the value 0x34.
I think you mean:
uint16_t var1 = 0x1234; uint8_t var2; var2 = var1;
Yes, this will truncate var1 to fit within var1's data type, so var2 will be equal to 0x34.
var1
var2