阅读背景:

嵌入式环境中的#define vs enum(它们如何编译?)

来源:互联网 

This question has been done to death, and I would agree that enums are the way to go. However, I am curious as to how enums compile in the final code- #defines are just string replacements, but do enums add anything to the compiled binary? Or are they both equivalent at that stage. When writing firmware and memory is very limited, is there any advantage, no matter how small, to using #defines?This question has been done to death, and I wou




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: