Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

PreProcessor directives

Question posted by: nikki123 (Newbie) on July 24th, 2008 02:07 PM
Develope a program in C++ which takes input a file of C Language and Process
all #define (i.e. #define MAX 100, than replace every occurrence of MAX with 100).
(Macro value 100 can be an expression also.)
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
JosAH's Avatar
JosAH
Chief Editor
7,421 Posts
July 24th, 2008
03:04 PM
#2

Re: PreProcessor directives
You could also have a look at the -E and/or -P flags of your c compiler; it would
be a bit silly to write an entire preprocessor for that.

kind regards,

Jos

Reply
gpraghuram's Avatar
gpraghuram
Expert
1,089 Posts
July 25th, 2008
04:06 AM
#3

Re: PreProcessor directives
There is a program called cccp.c (I think it is available in the net)
Try that or else use -E option as suggested by JosAH

Raghu

Reply
Reply
Not the answer you were looking for? Post your question . . .
182,081 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top C / C++ Forum Contributors