Octal literal consists of 1 to 3 digits. 4-digit sequence like 102
is not supported. It seems this is treated as two characters: 10
and 2
.
What you want may be printf("x66 102
");
. This will print f B
if ASCII is used.
Quote from N1570 6.4.4.4 Character constants:
octal-escape-sequence:
octal-digit
octal-digit octal-digit
octal-digit octal-digit octal-digit
The octal digits that follow the backslash in an octal escape sequence are taken to be part
of the construction of a single character for an integer character constant or of a single
wide character for a wide character constant. The numerical value of the octal integer so
formed specifies the value of the desired character or wide character.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…