Purpose of Trigraph sequences in C++?

This question (about the closely related digraphs) has the answer. It boils down to the fact that the ISO 646 character set doesn’t have all the characters of the C syntax, so there are some systems with keyboards and displays that can’t deal with the characters (though I imagine that these are quite rare nowadays). … Read more

When were the ‘and’ and ‘or’ alternative tokens introduced in C++?

From the first ISO C++ standard C++98, this is described in 2.5/ Alternative tokens [lex.digraph]: Alternative token representations are provided for some operators and punctuators. In all respects of the language, each alternative token behaves the same, respectively, as its primary token, except for its spelling. The set of alternative tokens is defined in Table … Read more

What does the ??!??! operator do in C?

??! is a trigraph that translates to |. So it says: !ErrorHasOccured() || HandleError(); which, due to short circuiting, is equivalent to: if (ErrorHasOccured()) HandleError(); Guru of the Week (deals with C++ but relevant here), where I picked this up. Possible origin of trigraphs or as @DwB points out in the comments it’s more likely … Read more