Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 2.14 KB

zc-trigraphs-trigraphs-substitution.md

File metadata and controls

36 lines (23 loc) · 2.14 KB
title description ms.date f1_keywords helpviewer_keywords ms.assetid
/Zc:trigraphs (Trigraphs Substitution)
A Microsoft C++ compiler option that controls conformance support for trigraphs.
07/25/2020
/Zc:trigraphs
-Zc compiler options (C++)
/Zc compiler options (C++)
Conformance compiler options
Zc compiler options (C++)
e3d6058f-400d-4966-a3aa-800cfdf69cbf

/Zc:trigraphs (Trigraphs Substitution)

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

Syntax

/Zc:trigraphs[-]

Remarks

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)
Trigraphs