Some C compilers permit multiple characters in a character constant.
This means that writing ‘yes’ instead of “yes” may well go undetected.
Source: C traps and pitfalls
Can anyone give an example of this where multiple characters are allowed in a character constant?
As Code Monkey cited, it is implementation defined and implementation varies — it isn’t just a BigEndian/LittleEndian and charset difference. I’ve tested four implementations (all using ASCII) with the program
and I got four different results
Big endian (AIX, POWER, IBM compiler)
Big endian (Solaris, Sparc, SUN compiler)
Little endian (Linux, x86_64, gcc)
Little endian (Solaris, x86_64, Sun compiler)