Open In App

cpp command in Linux with Examples

cpp is the C language preprocessor, it is automatically used by your C compiler to transform your program before compilation. It is also termed as a macro processor because it is used to give abbreviations for the longer piece of code. It can only be used with C, C++ and Objective-C source code. Using with other programming languages may cause uncertain problems.

Syntax:



cpp  [-options]  infile  outfile

Some Important Options:

Examples: We have created two codes to explain the concept we will refer them as code_a.c and code_b.c.



#include
void main()
{
  printf("Hello, World!");
}

code_a.c
#include
void main()
{
   printf(out);
}

code_b.c
Article Tags :