开发者

Storing #define macro value in temporary and re-use it

开发者 https://www.devze.com 2023-03-10 15:38 出处:网络
Is there any way to store a macro value into a tem开发者_运维问答porary and reuse it. pseudo Example:

Is there any way to store a macro value into a tem开发者_运维问答porary and reuse it. pseudo Example:

#define X 0

#ifdef X
#define T X
#undef X
#define X (T + 1) // now X should be 1
#endif


I don't see a way to achieve what you ask for. Depending on what you want to do with that, the use of __COUNTER__, a common extension, could help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消