Example =
#define a 100
#define b 200
main()
{
int c=a+b;
}
After preprocessing
Output-
#define a 100
main()
{
int c=a+200;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could try refactoring the macros to allow external configuration, i.e.
and
Then you can set the macros externally when building, for instance like this:
Now, of course you don’t have to use a separate configuration header, but I’d recommend it from a maintenance perspective, it will make it easier to keep track of available configuration settings and their defaults.