关于 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++ - C++11 中的 (Di|Tri) 图

c++ - 今天使用二合字母和三合字母吗?

C++ 17 为什么不删除二合字母和三合字母?

谁能说为什么传递给函数时数组没有改变

c - 函数中的malloc()结构,结束程序之前为free()

c - 如何将字符数组中的内容写入文本文件?

c - 如何使用 "Press any key to continue"消息显示长时间使用信息?

c - 动态字符数组 C 中的随机字符

c - 在 C 中返回指向 char 数组的指针

while-loop - 如何在仍然能够跳过迭代的同时迭代字符列表?