简体   繁体   English

C和C ++中的宏

[英]Macros in c & C++

在运行时是否可以定义或取消定义宏。

No. Macros are a preprocessor mechanism, and are fully resolved even before the compiler executes. 否。宏是一种预处理器机制,即使在编译器执行之前也已完全解析。

Their purpose is to alter the source code that the compiler sees, so they don't even exist at runtime (let alone permit modification). 它们的目的是更改编译器看到的源代码,因此它们甚至在运行时都不存在(更不用说允许修改了)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM