C++ has something called "multicharacter literals". '1234'
is an example of one. They have type int
, and it is implementation-defined what value they have and how many characters they can contain.
It's nothing directly to do with the fact that characters are represented as integers, but chances are good that in your implementation the value of '1234'
is defined to be either:
'1' + 256 * '2' + 256 * 256 * '3' + 256 * 256 * 256 * '4'
or:
'4' + 256 * '3' + 256 * 256 * '2' + 256 * 256 * 256 * '1'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…