Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.1 KB

c-preserve-comments-during-preprocessing.md

File metadata and controls

65 lines (50 loc) · 2.1 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
-C (Preserve Comments During Preprocessing) | Microsoft Docs
11/04/2016
cpp-tools
article
VC.Project.VCCLCompilerTool.KeepComments
/c
VC.Project.VCCLWCECompilerTool.KeepComments
C++
comments, not stripping during preprocessing
preserve comments during preprocessing
-c compiler option [C++]
c compiler option [C++]
/c compiler option [C++]
944567ca-16bc-4728-befe-d414a7787f26
11
corob-msft
corob
ghogen

/C (Preserve Comments During Preprocessing)

Preserves comments during preprocessing.

Syntax

/C  

Remarks

This compiler option requires the /E, /P, or /EP option.

The following code sample will display the source code comment.

// C_compiler_option.cpp  
// compile with: /E /C /c  
int i;   // a variable  

This sample will produce the following output.

#line 1 "C_compiler_option.cpp"  
int i;   // a variable  

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Working with Project Properties.

  2. Click the C/C++ folder.

  3. Click the Preprocessor property page.

  4. Modify the Keep Comments property.

To set this compiler option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.KeepComments%2A.

See Also

Compiler Options
Setting Compiler Options
/E (Preprocess to stdout)
/P (Preprocess to a File)
/EP (Preprocess to stdout Without #line Directives)