Trigraphs (historical)

suggest change

Early C environments did not always provide every character used by C's syntax. C therefore defined nine three-character sequences, called trigraphs, that were replaced early in translation:

Trigraph Replacement
??= #
??/ backslash
??' ^
??( [
??) ]
??! `
??< {
??> }
??- ~

Trigraphs were removed from C23. They can still matter when compiling older source in an earlier language mode, and some compilers require a dedicated option to enable or diagnose them.

Because replacement occurred inside comments, character constants, and string literals, an accidental sequence such as ??/ could change line splicing and produce surprising results. Do not introduce trigraphs in new code.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents