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

前端 未结 10 876
一个人的身影
一个人的身影 2020-11-22 05:44

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?

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 06:13

    On Windows OS, a simple one line answer to this question is to use the below command in DOS prompt to see the preprocessed file:

    CL /P /C myprogram.c
    

    This will generate a file called myprogram.i. Open it and look out for your expanded preprocessors.

提交回复
热议问题