以下对Trigraph sequences的描述摘自ANSI C标准,一般很少提到和用到。
2.2.1.1 Trigraph sequences
All occurrences in a source file of the following sequences of
three characters (called trigraph sequences /5/)are replaced with the
corresponding single character.
??= #
??( [
??/ \
??) ]
??' ^
??< {
??! |
??> }
??- ~
No other trigraph sequences exist. Each ? that does not begin one of
the trigraphs listed above is not changed.
Example
The following source line
printf("Eh???/n");
becomes (after replacement of the trigraph sequence ??/ )
printf("Eh?\n");
本文介绍了ANSI C标准中鲜为人知的Trigraph序列概念及其实现细节,详细列举了所有有效的Trigraph序列及其对应的字符替换规则,并通过示例展示了如何进行Trigraph序列的替换。
984

被折叠的 条评论
为什么被折叠?



