Assuming you are working on a 32-bit system:
the literal '3' character sizeof is 4, since character literals are int in C (but not in C ++).
sizeof "3" is 2 because it is an array literal with a length of 2 (number 3 plus a NULL terminator).
sizeof literal 3 is 4 because it is an int.
source
share