I have a macro defined. But I need to change this value at run time depending on a condition.
How can I implement this?
I have a macro defined. But I need to change this value at run
Share
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.
Macros are replaced by the preprocessor by their value before your source file even compiles. There is no way you’d be able to change the value of the macro at runtime.
If you could explain a little more about the goal you are trying to accomplish undoubtedly there is another way of solving your problem that doesn’t include macros.