How do I see a C/C++ source file after preprocessing in Visual Studio?

Geo picture Geo · Nov 10, 2008 · Viewed 94.2k times · Source

Let's say I have a source file with many preprocessor directives. Is it possible to see how it looks after the preprocessor is done with it?

Answer

bk1e picture bk1e · Nov 10, 2008

cl.exe, the command line interface to Microsoft Visual C++, has three different options for outputting the preprocessed file (hence the inconsistency in the previous responses about Visual C++):

If you want to preprocess to a file without #line directives, combine the /P and /EP options.