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) 

Post a Comment