In C++, sizeof(\'a\') == sizeof(char) == 1
. This makes intuitive sense, since \'a\'
is a character literal, and sizeof(char) == 1
as d
discussion on same subject
"More specifically the integral promotions. In K&R C it was virtually (?) impossible to use a character value without it being promoted to int first, so making character constant int in the first place eliminated that step. There were and still are multi character constants such as 'abcd' or however many will fit in an int."