Convert C/C++ program to Preprocessor code
We use g++ compiler to turn provided Cpp code into preprocessor code. To see the preprocessor code generated by the CPP compiler, we can use the “-E” option on the command line:
Preprocessor include all the # directives in the code. and also expands MACRO function.
Syntax: g++ -E filename.cpp
// MACRO named MAX initialism to 10 #define MAX 10 int main() { int a = MAX, b = MAX; // Add two values. int c = a + b; return 0; } |
chevron_right
filter_none
Running the command:
g++ -E geeks.cc
Output :
int main()
{
int a = 10, b = 10;
// Add two values.
int c = a + b;
return 0;
}
Recommended Posts:
- Convert C/C++ code to assembly language
- Printing source code of a C program itself
- How a Preprocessor works in C?
- C/C++ Preprocessor directives | Set 2
- C | Macro & Preprocessor | Question 8
- C | Macro & Preprocessor | Question 6
- C | Macro & Preprocessor | Question 11
- C | Macro & Preprocessor | Question 12
- C | Macro & Preprocessor | Question 15
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 10
- C | Macro & Preprocessor | Question 1
- C | Macro & Preprocessor | Question 7
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 4
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



