Puzzles 9 and 12 assume sizeof(int) is 2. It's poor form for a language lawyering quiz to make an assumption about implementation-dependent behavior. It's especially poor form when the assumption made is long outdated and likely to surprise--I suppose it's still true for C compilers targeting 8-bit and 16-bit microcontrollers. Aside: I remember buying the first Programmer's Heaven CD-ROM boxed set at The Party back i…
Was it possible to initialise a local array with literals like that (e.g. Q5) in C89? If not then the version of C in the examples (assuming it is consistent) must be at least C99, which suggests that sizeof(int)==2 is due to the target being an embedded device rather than the program being old. Edit: clarified that I am referring to local arrays only
Also, let's not forget what the C standard says about integer sizes, which is that
A) It is guaranteed that sizeof char == 1
B) It is guaranteed that the following holds true: sizeof char So it's always completely unrealistic to assume anything about the size of these types on any system, except for the guarantee in (A)