What is preprocessor in c programming language?

Answer:

All the preprocessor are not part of c program. It is only instruction to compiler. All the preprocessor process before the staring of actual compilation and create an intermediate file. In the intermediate file all preprocessor is converted in term of actual c.

To see the intermediate file:

Step 1: First create any c file let us assume test.c which contain : 

#define max 10+2

void main()

{

int a;

a=max*max;

printf(“%d”,a);

}

 

Step 2: go to command mode. Open run then write cmd then press enter.

Step 3: Go to the directory where test .c has been created.

Step 4: write in the command mode

cpp test.c and press enter key (to create intermediate file)

 

Step 5: type test.i (to see the intermediate file) 

6 comments:

ammu said...

awesome!!

thomas john isac said...

thank u so much....very useful work....

Sandeep Singh Sengar said...

Too much use full

Subrata said...

its awesome....thanks...

Unknown said...

it s vry useful to the lerners of c

Unknown said...

Nice Its very easy way to understand. SO Thanks!