Changing a macro at runtime in C

后端 未结 5 1441
野趣味
野趣味 2020-11-30 12:29

I have a macro defined. But I need to change this value at run time depending on a condition. How can I implement this?

5条回答
  •  孤街浪徒
    2020-11-30 13:00

    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.

提交回复
热议问题