prev up next   top/contents search

comp.lang.c FAQ list · Question 8.9

Q: I think something's wrong with my compiler: I just noticed that sizeof('a') is 2, not 1 (i.e. not sizeof(char)).

A: Perhaps surprisingly, character constants in C are of type int, so sizeof('a') is sizeof(int) (though this is another area where C++ differs). See also question 7.8, and this footnote .

References: ISO Sec.
H&S Sec. 2.7.3 p. 29

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North