Question
In C, why is sizeof(char) 1, when 'a' is an int?
I tried
printf("%d, %d\n", sizeof(char), sizeof('c'));
and got 1, 4 as output. If size of a character is one, why does 'c'
give me 4? I guess it's because it's an integer. So when I do char ch = 'c';
is there an implicit conversion happening, under the hood, from that 4 byte value to a 1 byte value when it's assigned to the char variable?