关于 ansi C 的奇怪的三字母序列

标签 c chars trigraphs

在 ansi C 中使用某些字符的三字母序列 变成其他字符的最初原因是什么,例如:

??=define arraycheck(a, b) a??(b??) ??!??! b??(a??)

成为

#define arraycheck(a, b) a[b] || b[a]

最佳答案

简答:不包含此类图形的键盘/字符编码。

来自维基百科:

The basic character set of the C programming language is a superset of the ASCII character set that includes nine characters which lie outside the ISO 646 invariant character set. This can pose a problem for writing source code when the keyboard being used does not support any of these nine characters. The ANSI C committee invented trigraphs as a way of entering source code using keyboards that support any version of the ISO 646 character set.

http://en.wikipedia.org/wiki/Digraphs_and_trigraphs

关于关于 ansi C 的奇怪的三字母序列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7376369/

相关文章:

c - 为什么 GCC 在使用三字母时发出警告,而在使用二字母时却不发出警告?

在 Ruby 中创建 C 扩展

c++ - 是否有像 docco 这样的 C/C++ 源代码文档生成器?

在某些情况下,数组输入打印错误结果的自定义函数?

C shift right 在我的程序中对 int 类型无法正常工作

java - 使用 Java 字符和字符串验证用户输入

c# - 为什么提供 String(char[]) 的隐式运算符不好?

c - 解决底层管理功能UD的建议