Share via

/Zc:trigraphs (Trigraphs Substitution)

When /Zc:trigraphs is specified, the compiler replaces a trigraph character sequence by using a corresponding punctuation character.




A trigraph consists of two consecutive question marks (??) followed by a unique third character. The C language standard supports trigraphs for source files that use a character set that doesn't contain convenient graphic representations for some punctuation characters. For example, when trigraphs are enabled, the compiler replaces the ??= trigraph by using the # character. Through C++14, trigraphs are supported as in C. The C++17 standard removes trigraphs from the C++ language. In C++ code, the /Zc:trigraphs compiler option enables substitution of trigraph sequences by the corresponding punctuation character. /Zc:trigraphs- disables trigraph substitution.

The /Zc:trigraphs option is off by default, and the option isn't affected when the /permissive- option is specified.

For a list of C/C++ trigraphs, and an example that shows how to use trigraphs, see Trigraphs.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > C/C++ > Command Line property page.

  3. Modify the Additional Options property to include /Zc:trigraphs or /Zc:trigraphs- and then choose OK.

See also

/Zc (Conformance)