I came across this line "The include directive instructs the preprocessor to paste the text of the given file into the current file".I want to know if the above statement is true or not.If it is,then why can't we see the text that has been pasted? source : http://www.cprogramming.com/reference/preprocessor/include.html
Asked
Active
Viewed 64 times
0
-
1You can see it if you use `-E` flag with gcc at compile time. It will generate the pasted output -- the full content that gets passed to the compilation phase. – R Sahu Feb 13 '15 at 05:58
1 Answers
1
You probably can... most compilers have a command line argument to output the code after preprocessing, i.e. expanding of #include
s, macros, selection using #if
/#ifdef
etc..
For GCC and clang it's -E
.
For Visual C++ it's /E
.

Tony Delroy
- 102,968
- 15
- 177
- 252
-
Hi Tony, Could you please tel me how /E can be used in MSVS C++ ? Where to add it.? – Shivaraj Bhat Feb 13 '15 at 07:41
-
2@ShivarajBhat: It's a command-line argument to the compiler In visual studio, it's found in the project properties. – MSalters Feb 13 '15 at 08:16
-
@ShivarajBhat: more info [here](http://stackoverflow.com/questions/8978997/how-can-i-see-the-output-of-the-visual-c-preprocessor) – Tony Delroy Feb 13 '15 at 09:34