Way to print a code with substituted macro..?

Is there any way to produce a code with all use dmacro to be substituted up to 'ready for compilation' condition?
Some macro are build up and it is hard to replace all them up to final code by hand.
I need to see the final line after all macro been applied by preprocessor.

How that could be done?

Thanks!

Pass the `-E' flag to gcc, which tells gcc to stop after the preprocessing stage. You should probably use a .i file extension (e.g. `gcc program.c -E -o program.i') since that's the standard for C source code that shouldn't be preprocessed.

Remember that if you #include anything, especially from the standard library, you'll get that in this file, so all your code will be right at the end.

Thank you! Exactly what I need!
Only one point: I am using the 'acc' and that compiler by the -E option does not produce the '-o "file"', but printing out on standart output; so, the result need to be redirected into desided file. (that's for anyone else to use this thread...)

You need the "-P" switch which stops acc after the preprocessing stage and produces a file with the same prefix as the source filename but with a ".i" extension.

Thank you, shamrock!
It is good to know!

You'd also be interested in exploring cpp ; Its the C pre Processor , available on most UNIX systems. However, I have used it mostly on my Linux ststems only :wink:

Just run the command:

 $ cpp Your_CprogFile.c > Your_preProcessed_CprogFile_output.c

I'm loving it!!!!:stuck_out_tongue: