Thursday, July 9, 2009

Any body give me output of the preprocessor for C language file.?

I want see exactly after proprocessor , what is going to happen to our .c file. It is going to convert some other extension file(hello.?).

Any body give me output of the preprocessor for C language file.?
Use -E option


example:-


gcc -E test.c %26gt; a
Reply:it is big issue dear... i am suggesting you that pls. dont think about it .. if you are thinks abt it so just contact to re putative companies those are developing these softwares ...
Reply:The # sign is called the preprocessor directive.


In C it is used to include the headers files in which the pre-defined function like #include%26lt;stdio.h%26gt; for printf() function.


actually when u save a file it is saved as e.g."hello.c", When u compile the program, a new file is genrated with extension "hello.obj"(if there is no syntactical error) and then linking is take place in which the pre defined function is linked with header files.


After that a new file with extension "hello.exe" is generate that will give the output after u run the program.








# is also used for "define"


e.g.-


#define size 10 //size can be a array length


Now u can use the size through out your program.


the main advantage of it is that if u have to change the length of array, then u r not going to modify the program everywhere u used 10 as size of array. u just to modify like


#define size 20


No comments:

Post a Comment