This can pose a problem for writing source code when the encoding (and possibly 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.
Because the printable range of ASCII is smaller than APL's specialized set of symbols, .
The C preprocessor (used for C and with slight differences in C++; see below) replaces all occurrences of the nine trigraph sequences in this table by their single-character equivalents before any other processing (until C23[5]).
[6][7] A programmer may want to place two question marks together yet not have the compiler treat them as introducing a trigraph.
tokens, so the only places in a C file where two question marks in a row may be used are in multi-character constants, string literals, and comments.
In 1994, a normative amendment to the C standard, C95,[9][10] included in C99, supplied digraphs as more readable alternatives to five of the trigraphs.
If a digraph sequence occurs inside another token, for example a quoted string, or a character constant, it will not be replaced.
Nonetheless, those alternative tokens that aren't lexical keywords are colloquially known as "digraphs".Trigraphs were proposed for deprecation in C++0x, which was released as C++11.
[13] This was opposed by IBM, speaking on behalf of itself and other users of C++,[14] and as a result trigraphs were retained in C++11.
[15] This passed a committee vote, and trigraphs (but not the additional tokens) are removed from C++17 despite the opposition from IBM.
[15] Hewlett-Packard calculators supporting the RPL language and input method provide support for a large number of trigraphs (also called TIO codes) to reliably transcribe non-seven-bit ASCII characters of the calculators' extended character set[17][18][19] on foreign platforms, and to ease keyboard input without using the CHARS application.