0
Can someone help me to understand this code ↓ ?
// Why this output ?? #include <stdio.h> #include<stdlib.h> int main (){ unsigned char x =300; printf("%d",x); return 0; } //Output : 44
11 ответов
+ 2
FF9900 it just output 44 is for what i hoped to show 300
+ 2
44
+ 2
It given the overflow number instend of the rest
+ 2
Where going the 256 bits rest so
+ 1
Mik_RDC
unsigned char is from 0 to 255.
Go over that and it starts from 0 again. so 256 = 0, 257=1... 300=44.
+ 1
You declared a char type but assigned it an int type... Therefore unsigned conversion of int to unsigned conversion to char outputs a number your case 44