char a, b;
printf(\"%d\", sizeof(a+b));
What will printf write to the screen?
I thought because sizeof(char)=1, that sizeof(a+b) wil
This is not the same as sizeof(char), the argument (i.e. the result of the addition) is promoted to int so sizeof(a + b) is in fact equivalent to sizeof(int). If you cast the result to char it will be what you expect. Also, the correct format specifier for sizeof result which is size_t is %zu and not %d.
Try
printf("%zu", sizeof((char) (a + b)));