Trigraph char sequences in C & C++
![]()
There are some triplet character sequences present in C & C++ to represent some special punctuation characters. The trigraph sequences are used for compatibility of source code written in ISO 646 or EBCDIC charset.
![]()
// Is this a valid statement? I can’t believe. But for compiler is valid.
??=define arraycheck(a,b) a??(b??) ??!??! b??(a??)
But when we apply trigraph sequence, the above code block became as follows.
// Wow!!! It’s a valid one…
#define arraycheck(a,b) a[b] || b[a]
Please see list of trigraph sequences below.
Trigraph Punctuation Character
??= #
??( [
??/ \
??) ]
??’ ^
??< {
??! |
??> }
??- ~
And one trigraph pitfall.
// Whether the following line compiles ???????/
cout << “Whether you can see this message?”;
Find your answer and take care trigraphs next time…
Thanks to Wiki for examples and the list.
I didn’t know that !!!.. Thanks…
Mee too. . . Thanks for the info!
REally new to me too…
IS there any use of this Trigraph?
For what actually it’s Created for?
Got A Link…
http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/compiler/ref/ruopttri.htm
[...] Its worth reading about trigraphs chars at this moment. http://weseetips.com/2008/03/25/trigraph-char-sequences-in-c-c/ [...]